Skip to main content

Handling events

When the Amplify Template Editor SDK instance is initialized, you can use event listeners to handle events emitted by the editor.

load

This event is emitted when the editor is initiated without any errors.

editor.on('load', () => {
console.log('Template Editor is successfully loaded!');
// Your custom logic here...
});

close

This event is emitted when the editor is closed without saving template data.

editor.on('close', () => {
console.log('Template Editor is closed');
});

finish

This event is emitted when the editor saved template data and finished.

editor.on('finish', () => {
// Thumbnail generation started
console.log('Template Editor is successfully saved template data');
});

After this event is emitted, Amplify will perform the final processing step to make the template available for use. You can monitor status of the template via polling GET https://api.shakr.com/v2/template_style_versions/:template_style_version_id API or Webhook. See After Template Editor SDK process section for detailed information of each statuses.

Please refer to SDK Reference for more information.