onBackClick
Registers a callback that runs when a user clicks the Back button in the editor's header.
This function does not run when then the user uses the native "back" feature in their browser.
If you don't register the onBackClick callback, the "Back" button still appears in the Canva editor, but nothing happens when the user clicks it.

Usage

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 onBackClick = () => {
9
// the user has clicked the "Back" button in the editor's header
10
console.log("You clicked the 'Back' button!");
11
};
12
13
const onProductSelect = (opts) => {
14
api.createDesign({
15
...opts,
16
onBackClick,
17
});
18
};
19
20
api.showCatalog({
21
onProductSelect,
22
});
23
})();
Copied!
Last modified 8mo ago
Export as PDF
Copy link
Contents
Usage