editDesign

Opens an existing design in the editor.
(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 ID
let designId;
const onProductSelect = (opts) => {
api.createDesign({
...opts,
onDesignOpen: (opts) => {
designId = opts.designId;
},
});
};
// The user creates a new design
api.showCatalog({
onProductSelect,
});
// If the user navigates away from the design,
// you can open it again at a later time.
api.editDesign({ designId });
})();
javascript
ParameterTypeRequiredDescription
optsobjectYesOptions for configuring the editor.
opts.designIdstringYesThe ID of an existing design to open in the editor.
opts.onArtworkCreate (deprecated)functionNoSee onArtworkCreate. This parameter is superseded by opts.onMultiArtworkCreate.
opts.onBackClickfunctionNoRefer to onBackClick.
opts.onDesignOpenfunctionNoRefer to onDesignOpen.
opts.onMultiArtworkCreatefunctionNoSee onMultiArtworkCreate.
opts.publishLabelstringNoA label for the editor's Publish button.