Notion Helper - v1.3.33
    Preparing search index...

    Function createBlock

    • Creates an embed block.

      Parameters

      • options: string | Object

        A string representing the URL to be embedded, a UUID that represents a file upload, or an options object.

        • string
        • Object
          • url

            The URL to be embedded.

          • file_upload

      Returns Object

      An embed block object compatible with Notion's API.

      // Use with a URL string
      const simpleEmbed = block.embed.createBlock("https://www.youtube.com/watch?v=ec5m6t77eYM");

      // Use with a UUID string (file upload)
      const simpleFileUploadEmbed = block.embed.createBlock("24142df2c64080g28b18edb72f486550")

      // Use with options object with URL
      const complexEmbed = block.embed.createBlock({
      url: "https://www.youtube.com/watch?v=ec5m6t77eYM"
      });

      // Use with options object with file upload
      const complexFileUploadEmbed = block.embed.createBlock({
      type: "file_upload",
      file_upload: {
      id: "24142df2c64080g28b18edb72f486550"
      }
      })