onMultiArtworkCreate
Registers a callback that runs when a user finishes proofing their design.
The Partnership SDK refers to a proofed design as an artwork.

Usage

1
(async () => {
2
const api = await Canva.Partnership.initialize({
3
apiKey: "<partner_api_key>",
4
autoAuthToken: "<auto_auth_token>",
5
container: document.getElementById("container"),
6
});
7
8
const onMultiArtworkCreate = (opts) => {
9
opts.artworks.forEach((artwork) => {
10
console.log(artwork);
11
});
12
};
13
14
const onProductSelect = (opts) => {
15
api.createDesign({
16
...opts,
17
onMultiArtworkCreate,
18
});
19
};
20
21
api.showCatalog({
22
onProductSelect,
23
});
24
})();
Copied!

Parameters

Name
Type
Required
Description
opts
object
Yes
Information about a user's proofed design.
opts.artworks
Array<Artwork>
Yes
List of artworks representing a user's proofed designs.

Types

Artwork

Represents an individual artwork.

Properties

To understand the meaning of the Volatile column, see the definition of Volatile parameters in the Glossary.
Name
Type
Required
Volatile
Description
previewImages
Array
Yes
Yes
A 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)
string
Yes
Yes
The URL of a low-resolution preview of the artwork. This parameter is superseded by previewImages.
artworkId
string
Yes
No
The ID of the user's artwork.
artworkTitle
string
Yes
No
The title of the user's artwork.
designId
string
Yes
No
The design ID of the user's artwork.
pageCount
number
Yes
No
The number of the pages in the artwork.
partnerProductId
string
Yes
No
The 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.
Last modified 1mo ago
Export as PDF
Copy link