> ## Documentation Index > Fetch the complete documentation index at: https://www.canva.dev/docs/print-partnerships/llms.txt > Use this file to discover all available pages before exploring further. # onDesignClose Registers a callback that runs when a user closes the Canva editor. ## Usage ```javascript (async () => { const api = await Canva.Partnership.initialize({ apiKey: "", autoAuthToken: "", container: document.getElementById("container"), }); const onDesignClose = () => { // the user has closed the Canva editor console.log("You closed the Canva editor!"); }; const onProductSelect = (opts) => { api.createDesign({ ...opts, onDesignClose, }); }; api.showCatalog({ onProductSelect, }); })(); ```