> ## Documentation Index > Fetch the complete documentation index at: https://www.canva.dev/docs/button/llms.txt > Use this file to discover all available pages before exploring further. # initialize API reference for the JavaScript API's initialize method. Initializes the JavaScript API for the Canva Button. You must embed the Canva Button SDK before calling this function. ## Usage ```javascript (async () => { if (!window.Canva || !window.Canva.DesignButton) { return; } const api = await window.Canva.DesignButton.initialize({ apiKey: "API KEY GOES HERE", }); })(); ``` ## Parameters | Name | Type | Required | Description | | :------------ | :----- | :------: | :-------------------------------------------- | | `opts` | object | Yes | Options for configuring the Canva Button API. | | `opts.apiKey` | string | Yes | Your API key for the Canva Button. | ## Returns | Name | Type | Required | Description | | :----------------- | :------- | :------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `api` | object | Yes | An object that contains functions for interacting with Canva. | | `api.createDesign` | function | Yes | A function that creates a new design in the Canva editor. For more information, see [createDesign](https://www.canva.dev/docs/button/javascript/api-reference/create-design/). | | `api.editDesign` | function | Yes | A function that opens an existing design in the Canva editor. For more information, see [editDesign](https://www.canva.dev/docs/button/javascript/api-reference/edit-design/). |