onMultiArtworkCreate

Registers a callback that runs when a user finishes proofing their design.
(async () => {
const api = await Canva.Partnership.initialize({
apiKey: "<partner_api_key>",
autoAuthToken: "<auto_auth_token>",
container: document.getElementById("container"),
});
const onMultiArtworkCreate = (opts) => {
opts.artworks.forEach((artwork) => {
console.log(artwork);
});
};
const onProductSelect = (opts) => {
api.createDesign({
...opts,
onMultiArtworkCreate,
});
};
api.showCatalog({
onProductSelect,
});
})();
js
NameTypeRequiredDescription
optsobjectYesInformation about a user's proofed design.
opts.artworksArray<Artwork>YesList of artworks representing a user's proofed designs.

Represents an individual artwork.

NameTypeRequiredVolatileDescription
previewImagesArray<string>YesYesA list of URLs for previewing a low-resolution version of the artwork. For JPG and PNG file formats, there's a separate URL for each page. For PDF file formats, there's one URL for the entire preview. The URL is in the form https://partnership-artwork.canva.com/<export_file>. If you're using the China version of the SDK, the TLD is .cn instead of .com. You can take the necessary security measures to protect the URL from any malicious attacks.
previewImageSrc (deprecated)stringYesYesThe URL of a low-resolution preview of the artwork. This parameter is superseded by previewImages.
artworkIdstringYesNoThe ID of the user's artwork.
artworkTitlestringYesNoThe title of the user's artwork.
designIdstringYesNoThe design ID of the user's artwork.
pageCountnumberYesNoThe number of the pages in the artwork.
partnerProductIdstringYesNoThe ID of a product in Canva's back-end. A partner product ID determines the dimensions, the templates, the furniture (if applicable), and the export settings to apply for a design. A partner may provide a partner product ID to Canva beforehand. This may match with a product ID in a partner's back-end, such as SKU or internal system identifier. If partner doesn't provide a partner product ID, Canva assigns one for each product.