Configuration not persisting between reloads during localhost Hosted Test (ext.configuration.broadcaster becomes undefined)

Hi! I’m testing my extension locally with Hosted Test and I’m seeing an issue with Configuration persistence.
Setup:

  • I host my views locally over HTTPS: https://localhost:8080 (config.html and video_component.html).

  • I start a live stream so I can open the extension on my channel.

  • In the extension’s Config view, I save config to the broadcaster segment and also broadcast an update:

const ext = window.Twitch.ext;
const version = new Date().toISOString();
const content = JSON.stringify({ nickname: “foo” });

ext.configuration.set(“broadcaster”, version, content);

ext.send?.(
“broadcast”,
“application/json”,
JSON.stringify({ type: “config_updated”, data: { nickname: “foo” } })
);

In the Video Component view, I listen to:

ext.listen("broadcast", ...)
ext.configuration.onChanged(...)
ext.onAuthorized(...)

Behavior:

  • Immediately after saving, the video component receives the broadcast and also reacts to configuration changes as expected.

  • However, if I reload the Twitch page with the stream and reopen the extension, ext.onAuthorized fires, but ext.configuration.broadcaster is undefined. It looks like the saved config isn’t persisted, and I have to re-enter it via the config view again.

    Questions:

  1. Am I missing a step to persist the Configuration Service data during Hosted Test on localhost?

  2. Is this expected behavior in local/Hosted Test (e.g., config not persisted between page reloads), and will it behave differently once hosted on a server or in a packaged version?

  3. Are there any known caveats about when ext.configuration.onChanged fires relative to ext.onAuthorized, or about accessing ext.configuration.broadcaster on first load?

Any guidance on the correct testing flow or what I might be doing wrong would be appreciated. Thanks!

Is the configuration service actually enabled in the developer console for this version of the extension?

Hi! I read the doc at https://dev.twitch.tv/docs/tutorials/extension-101-tutorial-series/config-service/ and went into the developer console https://dev.twitch.tv/console/extensions, but I can’t find where exactly the Configuration Service should be enabled. Can you advise?

  1. Dev Console Twitch Developers
  2. Manage an extension
  3. Manage a version of the extension
  4. Click Capabilities
  5. Under Select how you will configure your extension. select Extension Configuration Service
  6. Save

1 Like

Oh my god, that helped—thank you! I must have missed that part)