onDesignClose
Registers a callback that runs when a user closes the Canva editor.
1
(async () => {
2
const api = await Canva.Partnership.initialize({
3
apiKey: "<partner_api_key>",
4
autoAuthToken: "<auto_auth_token>",
5
container: document.getElementById("container"),
6
});
7
8
const onDesignClose = () => {
9
// the user has closed the Canva editor
10
console.log("You closed the Canva editor!");
11
};
12
13
const onProductSelect = (opts) => {
14
api.createDesign({
15
...opts,
16
onDesignClose,
17
});
18
};
19
20
api.showCatalog({
21
onProductSelect,
22
});
23
})();
Copied!
Last modified 8mo ago
Export as PDF
Copy link