> ## 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. # onDesignPublish API reference for the JavaScript API's onDesignPublish method. A function that runs when a user publishes a design. ## Usage ```javascript api.createDesign({ design: { type: "Poster", }, onDesignPublish: (opts) => { console.log(opts); }, }); ``` **Tip:** You can pass the `onDesignPublish` function into the [`createDesign`](https://www.canva.dev/docs/button/javascript/api-reference/create-design/) and [`editDesign`](https://www.canva.dev/docs/button/javascript/api-reference/edit-design/) functions. ## Parameters | Name | Type | Required | Description | | :----------------- | :----- | :------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `opts` | object | Yes | Parameters that Canva passes into the function. | | `opts.designId` | string | Yes | The ID of the user's design. | | `opts.designTitle` | string | Yes | The title of the user's design. | | `opts.exportUrl` | string | Yes | The URL for downloading the user's design. This URL expires after 15 minutes. The URL is in the form `https://export-download.canva.com/`. If you're using the China version of the SDK, the TLD is `.cn` instead of `.com`. You can take the necessary security measures to protect the URL from any malicious attacks. | ## Returns `void`