onDesignOpen

Registers a callback that runs when a user opens a new or existing design in the editor.
(async () => {
const api = await Canva.Partnership.initialize({
apiKey: "<partner_api_key>",
autoAuthToken: "<auto_auth_token>",
container: document.getElementById("container"),
});
const onDesignOpen = (opts) => {
// the user has opened a new or existing design
console.log(opts);
};
const onProductSelect = (opts) => {
api.createDesign({
...opts,
onDesignOpen,
});
};
api.showCatalog({
onProductSelect,
});
})();
javascript
ParameterTypeRequiredVolatileDescription
optsobjectYesN/AInformation about the opened design.
opts.designIdstringYesNoThe ID of the user's design.
opts.designTitlestringYesNoThe title of the user's design.