onDesignOpen
Registers a callback that runs when a user opens a new or existing design in the editor.
Usage
(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 designconsole.log(opts);};const onProductSelect = (opts) => {api.createDesign({...opts,onDesignOpen,});};api.showCatalog({onProductSelect,});})();
javascript