onDesignSelect

Registers a callback that runs when a user selects a design via the "My Designs" carousel.

The "My Designs" carousel only appears if the onDesignSelect callback is registered.

Usage

(async () => {
const api = await Canva.Partnership.initialize({
apiKey: "<partner_api_key>",
autoAuthToken: "<auto_auth_token>",
container: document.getElementById("container"),
});
const onDesignSelect = (opts) => {
// the user has selected a design via the catalog
console.log(opts);
};
api.showCatalog({
onDesignSelect,
});
})();

Parameters

To understand the meaning of the Volatile column, see the definition of Volatile parameters in the Glossary.

Parameter

Type

Required

Volatile

Description

opts

object

Yes

N/A

Information about the selected design.

opts.designId

string

Yes

No

The ID of an existing design.

opts.maxPages

number

Yes

No

The maximum number of pages a user can print for the design's associated product.

opts.partnerProductId

string

Yes

No

The ID of a product in the partner's backend.