Widget.on
Widget.on(name, handler): () => voidWidget.on listens to an event by its Streamer.bot name (Twitch.Follow, Kick.Follow, Youtube.NewSubscriber…).
The handler receives an object with the same fields on every platform, plus platform and raw
(the original payload). It returns a function to unsubscribe.
const stop = Widget.on("Twitch.Follow", ({ user, platform }) => { Widget.dom.text(document.querySelector("#app"), `${user} (${platform})`);});- It must be declared. Every event you listen to must be in
eventsofmanifest.json; otherwise the validator flags it. - Platforms turned off. If the viewer turns a platform off in “Platforms” (in “Configure”), its events do not arrive.
- TikTok arrives through TikFinity, at
ws://localhost:<tiktokPort>(21213 by default): a separate connection that opens with the first TikTok event and retries by itself. A gift with a streak arrives once, when it ends. In “Test”, the simulator sends them. - Names are not made up. The full list, with the fields and an example of each, is in the events reference.