initialize

Initializes the Partnership SDK.
(async () => {
const api = await Canva.Partnership.initialize({
apiKey: "<api_key>",
autoAuthToken: "<auto_auth_token>",
container: document.getElementById("container"),
locale: "fr-CA",
});
})();
javascript
ParameterTypeRequiredDescription
optsobjectYesOptions for initializing the SDK.
opts.apiKeystringYesThe integration's Partner API key.
opts.autoAuthTokenstringNoThe integration's authAuthToken.
opts.containerHTMLElementNoThe element where the SDK renders the product catalog and the Canva editor.
opts.localestringNoThe language code the SDK uses to render the product catalog and the Canva editor. If not set, the SDK determines the locale from the user's browser settings. If set, the SDK ignores the user's browser settings.
ParameterTypeRequiredDescription
apiobjectYesAPI methods for defining the behavior of the integration.
api.showCatalogfunctionYesRefer to showCatalog.
api.createDesignfunctionYesRefer to createDesign.
api.editDesignfunctionYesRefer to editDesign.