onDesignOpen

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

Usage

(async () => {
const api = await Canva.Partnership.initialize({
apiKey: "<partner_api_key>",
autoAuthToken: "<auto_auth_token>",
container: document.getElementById("container"),
});
const onDesignOpen = (opts) => {
// the user has opened a new or existing design
console.log(opts);
};
const onProductSelect = (opts) => {
api.createDesign({
...opts,
onDesignOpen,
});
};
api.showCatalog({
onProductSelect,
});
})();

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.