editDesign
Opens an existing design in the editor.
When a user edits an existing design, they are editing the live version of the design. Any changes they make are not reflected in an already purchased artwork.

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
// Keep track of a design's ID
9
let designId;
10
11
const onProductSelect = (opts) => {
12
api.createDesign({
13
...opts,
14
onDesignOpen: (opts) => {
15
designId = opts.designId;
16
},
17
});
18
};
19
20
// The user creates a new design
21
api.showCatalog({
22
onProductSelect,
23
});
24
25
// If the user navigates away from the design,
26
// you can open it again at a later time.
27
api.editDesign({ designId });
28
})();
Copied!

Parameters

Parameter
Type
Required
Description
opts
object
Yes
Options for configuring the editor.
opts.designId
string
Yes
The ID of an existing design to open in the editor.
opts.onArtworkCreate (deprecated)
function
No
See onArtworkCreate. This parameter is superseded by opts.onMultiArtworkCreate.
opts.onBackClick
function
No
Refer to onBackClick.
opts.onDesignOpen
function
No
Refer to onDesignOpen.
opts.onMultiArtworkCreate
function
No
opts.publishLabel
string
No
A label for the editor's Publish button.
To set the minimum and maximum number of pages, raise a ticket and request Canva to set them up in the backend. Don’t set them via the opts.minPages and opts.maxPages parameters. The SDK ignores these parameters.
Last modified 20d ago
Export as PDF
Copy link