["editor", "files"]. Installing the SDK, tokens, the theme, the language and the Content Security Policy are the same for every piece, and are on the UI Components page. This page covers what is specific to the Composition Editor.
Mount it
Create the composition on your server with your key and file it under the customer (see Filing Content Under a Managed User). A session opens only compositions filed under its customer. Then mount the editor on it:Options
Events
Saving
- The editor saves by itself shortly after the last change.
editor.module.save()saves what is unsaved now,editor.module.flush()saves everything unsaved and waits until it is (both resolvetruewhen nothing is left unsaved), andeditor.module.isDirty()tells whether anything is unsaved. A save is safe to retry: it carries anIdempotency-Key. unmount()saves first, for up to 10 seconds, so closing the editor never loses the last edits. If some could not be saved you hear anerrorwith the codeUNSAVED_ON_UNMOUNT.editor.module.unmount({ discard: true })throws unsaved edits away instead.
When something goes wrong
- Problems are shown to the customer by the editor itself, with “Try again” where that helps.
erroris for your page, and addsduring,status,retryable,sessionEndedandcorrelationIdto the usual fields.fatal: truemeans the editor cannot go on: the composition cannot be opened, or the session is over (sessionEnded: true). Make a new session or take the editor away. QuotecorrelationIdto Widgetic’s support. - Another customer’s composition is answered with
404, and the editor says it cannot be opened.
Next Steps
Editor Sessions
Make the token on your server
UI Components
The SDK, tokens, the look and the language of every piece
Managed Users
File your customers’ compositions under them
Compositions
Make a composition with your key