onImageUpdate
API reference for the "onImageUpdate" method.
Registers a callback that runs when Canva requests the extension to update the user's image.
const canva = window.canva.init();
canva.onReady(async (opts) => {
// This callback must exist for the extension to start
});
canva.onImageUpdate(async (opts) => {
console.log(opts);
});
Name | Type | Required | Description |
---|---|---|---|
handler | Yes | The callback that runs when Canva requests the extension to update the user's image. |
void
The callback that runs when Canva requests the extension to update the user's image.
Signature
(opts) => void
Parameters
Name | Type | Required | Description |
---|---|---|---|
opts | object | Yes | Information about the event. |
opts.image | Yes | The updated version of the user's image. |
Returns
void
Last modified 1yr ago