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

(async () => {
const api = await Canva.Partnership.initialize({
apiKey: "<partner_api_key>",
autoAuthToken: "<auto_auth_token>",
container: document.getElementById("container"),
});
// Keep track of a design's ID
let designId;
const onProductSelect = (opts) => {
api.createDesign({
...opts,
onDesignOpen: (opts) => {
designId = opts.designId;
},
});
};
// The user creates a new design
api.showCatalog({
onProductSelect,
});
// If the user navigates away from the design,
// you can open it again at a later time.
api.editDesign({ designId });
})();

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.minPages

number

No

The minimum number of pages a user can print.

opts.maxPages

number

No

The maximum number of pages a user can print.

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

See onMultiArtworkCreate.

opts.publishLabel

string

No

A label for the editor's Publish button.