onImageUpdate
API reference for the "onImageUpdate" method.
Registers a callback that runs when Canva requests the extension to update the user's image.
The onImageUpdate callback runs immediately before the onSaveRequest callback.

Usage

1
const canva = window.canva.init();
2
3
canva.onReady(async (opts) => {
4
// This callback must exist for the extension to start
5
});
6
7
canva.onImageUpdate(async (opts) => {
8
console.log(opts);
9
});
Copied!

Parameters

Name
Type
Required
Description
handler
Yes
The callback that runs when Canva requests the extension to update the user's image.

Returns

void

Types

ImageUpdateHandler

The callback that runs when Canva requests the extension to update the user's image.
Signature
1
(opts) => void
Copied!
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