onBackClick

Registers a callback that runs when a user clicks the Back button in the editor's header.
(async () => {
const api = await Canva.Partnership.initialize({
apiKey: "<partner_api_key>",
autoAuthToken: "<auto_auth_token>",
container: document.getElementById("container"),
});
const onBackClick = () => {
// the user has clicked the "Back" button in the editor's header
console.log("You clicked the 'Back' button!");
};
const onProductSelect = (opts) => {
api.createDesign({
...opts,
onBackClick,
});
};
api.showCatalog({
onProductSelect,
});
})();
javascript