When a user edits an existing design, they are editing the live version of the design. Any changes they make are not reflected in an already purchased artwork.
Usage
(async () => {const api = await Canva.Partnership.initialize({apiKey: "<partner_api_key>",autoAuthToken: "<auto_auth_token>",container: document.getElementById("container"),});// Keep track of a design's IDlet designId;const onProductSelect = (opts) => {api.createDesign({...opts,onDesignOpen: (opts) => {designId = opts.designId;},});};// The user creates a new designapi.showCatalog({onProductSelect,});// If the user navigates away from the design,// you can open it again at a later time.api.editDesign({ designId });})();
JAVASCRIPT
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
opts | object | Yes | Options for configuring the editor. |
opts.designId | string | Yes | The ID of an existing design to open in the editor. |
opts.onArtworkCreate (deprecated) | function | No | See onArtworkCreate. This parameter is superseded by opts.onMultiArtworkCreate . |
opts.onBackClick | function | No | Refer to onBackClick. |
opts.onDesignOpen | function | No | Refer to onDesignOpen. |
opts.onMultiArtworkCreate | function | No | See onMultiArtworkCreate. |
opts.publishLabel | string | No | A label for the editor's Publish button. |
By default, a user can print a minimum of 1 page and a maximum of 2 pages per design. To change these settings, raise a ticket and request Canva to set them up in the backend. Don't set them via the opts.minPages
and opts.maxPages
parameters. The SDK ignores these parameters.