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