onDesignOpen
API reference for the JavaScript API's onDesignOpen method.
A function that runs when a user opens a design. This includes when a user creates a new design or edits an existing design.

Usage

1
api.createDesign({
2
design: {
3
type: "Poster",
4
},
5
onDesignOpen: (opts) => {
6
console.log(opts);
7
},
8
});
Copied!
You can pass the onDesignOpen function into the createDesign and editDesign functions.

Parameters

Name
Type
Required
Description
opts
object
Yes
Parameters that Canva passes into the function.
opts.designId
string
Yes
The ID of the user's design.
opts.designTitle
string
Yes
The title of the user's design.

Returns

void
Copy link