Skip to main content
Widgets reload every time the overlay loads. Anything in a variable is gone. StreamWizard.state stores a JSON blob per placed widget, so death counters and sub goals survive OBS restarts and stream ends.

The API

Two calls. get() returns your saved object or null; set() replaces it. Spread the old state if you’re only changing one key.

A complete counter

Good to know

  • Per placement: two copies of the same widget on different overlays have separate state.
  • Editor preview has no state: get/set throw there, because the preview isn’t attached to an overlay. Wrap in try/catch or .catch() if you test in the editor a lot.
  • Don’t save on every frame: batch it. Save after a change settles, not inside an animation loop.
  • Older widgets using window.StreamWizard.stateUrl with manual fetch still work; state.get/set is the same API with the plumbing done.