EmbedEmbed SDKCreating/Updating Carousels

Create a new carousel

To create a new carousel, call the createDesign method and provide a callback function to handle the export data:

editor?.createDesign((data: ExportData) => {
    console.log(data);
    // You can perform additional operations with the data, such as saving or displaying the carousel
});

To edit an existing carousel, call the editDesign method and provide the carousel ID and a callback function to handle the export data:

editor?.editDesign('your-carousel-id', (data: ExportData) => {
    console.log(data);
    // You can perform additional operations with the data, such as updating the existing carousel
});

Replace your-carousel-id with the actual ID of the carousel you want to edit.

Understanding the ExportData type

The callback function receives an ExportData object, which contains the following properties:

interface ExportData {
    id: string;           // Unique identifier for the content
    name: string;         // User-defined content name
    size: string;         // Aspect ratio (e.g., "16:9", "1:1", "9:16")
    type: string;         // Export format: "pdf", "png", or "mp4"
    data: Blob | Blob[];  // File data - single Blob for PDF/MP4, Blob array for PNG
}

You can use the provided data to save, display, or perform any other operations with the carousel.