Skip to main content

Globals

onWidgetLoad and onFieldsUpdate also hand you the values as e.detail.fieldData. Read fieldData again after an update rather than keeping an old copy: the global is replaced, not edited in place.

Lifecycle events

All four arrive as DOM CustomEvents on window.

onWidgetLoad

Fires once when the widget mounts.

onEventReceived

Every live event. detail.listener names the event, detail.event is the payload. The full catalog with exact payload shapes lives in the event reference.

onFieldsUpdate

Fires when the streamer changes one of your fields while the widget is running. Handle it to update in place; if you don’t, the editor reloads the widget to show the change, restarting your script.

onSessionUpdate

Reserved. Nothing emits it today; don’t build on it.

Bundled libraries

  • Tailwind CSS via CDN: use utility classes directly in your HTML.
  • GSAP 3.12.5 + TextPlugin: timelines, easings, text animation.
No other external scripts load, and the sandbox blocks adding your own script tags from other origins. fetch() works against the StreamWizard state API, your media library files, and the weather/geocoding APIs used by IRL widgets.

The editor knows all of this

The JS tab autocompletes every global, event name, and payload field on this page. When in doubt, type e.detail. and read what comes up.