onDesignOpen
Registers a callback that runs when a user opens a new or existing design in the editor.

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 onDesignOpen = (opts) => {
9
// the user has opened a new or existing design
10
console.log(opts);
11
};
12
13
const onProductSelect = (opts) => {
14
api.createDesign({
15
...opts,
16
onDesignOpen,
17
});
18
};
19
20
api.showCatalog({
21
onProductSelect,
22
});
23
})();
Copied!

Parameters

To understand the meaning of the Volatile column, see the definition of Volatile parameters in the Glossary.
Parameter
Type
Required
Volatile
Description
opts
object
Yes
N/A
Information about the opened design.
opts.designId
string
Yes
No
The ID of the user's design.
opts.designTitle
string
Yes
No
The title of the user's design.
Last modified 3mo ago
Export as PDF
Copy link