initialize
Initializes the Partnership SDK.

Usage

1
(async () => {
2
const api = await Canva.Partnership.initialize({
3
apiKey: "<api_key>",
4
autoAuthToken: "<auto_auth_token>",
5
container: document.getElementById("container"),
6
locale: "fr-CA"
7
});
8
})();
Copied!

Parameters

Parameter
Type
Required
Description
opts
object
Yes
Options for initializing the SDK.
opts.apiKey
string
Yes
The integration's Partner API key.
opts.autoAuthToken
string
No
The integration's authAuthToken.
opts.container
HTMLElement
No
The element where the SDK renders the product catalog and the Canva editor.
opts.locale
string
No
The code of a locale's language 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.

Returns

Parameter
Type
Required
Description
api
object
Yes
API methods for defining the behavior of the integration.
api.showCatalog
function
Yes
Refer to showCatalog.
api.createDesign
function
Yes
Refer to createDesign.
api.editDesign
function
Yes
Refer to editDesign.
Last modified 1mo ago
Export as PDF
Copy link