You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rather than #50, we should use EventSub to subscribe to streamer online and offline notifications directly. Later we can also use chat over EventSub.
Using EventSub over WebSockets directly would be fine, but it is probably better to use a conduit with one shard for full instant reconnect. Not sure what the UX for creating the conduit should be, though. It seems fine to Get Conduits and use whatever we see or Create Conduit if we see nothing.
It seems like chat over EventSub will also be easy. The rough outline of how we do auth for it (thanks to BarryCarlyon):
Get an app access token through client credentials grant flow. This is trivial, and we'll need it for other EventSub subscriptions anyway.
Get a user access token for the bot's user account through the device code flow or authorization code grant flow that we're already using. We need user:read:chat, user:write:chat, and newly user:bot scopes.
Have the broadcaster use implicit grant flow to connect to the Robot app, with the redirect being to a GitHub Pages or other static site on the public internet. This needs only channel:bot scope. Since we don't need to perform any moderator actions or similar, we can discard this user access token; just having the account connection is sufficient.
Use the app access token to Send Chat Message through the API. Note this will continue to work after the channel:bot token expires.
user.whisper.message maybe, requires user:manage:whispers scope in the bot's user access token
Given the limit of 300 subscriptions per WebSocket EventSub connection, that means 33-50 broadcasters per shard. Plenty for now; if we need to support more than that, we'll probably want to switch to webhooks anyway.
Activity
zephyrtronium commentedon Aug 24, 2024
It seems like chat over EventSub will also be easy. The rough outline of how we do auth for it (thanks to BarryCarlyon):
That means overall we will need to subscribe to:
Given the limit of 300 subscriptions per WebSocket EventSub connection, that means 33-50 broadcasters per shard. Plenty for now; if we need to support more than that, we'll probably want to switch to webhooks anyway.
auth: add client credentials flow
twitch: add conduits api calls
twitch: initial work on conduit shard apis
twitch: support paginated apis
twitch: return update conduit errors
twitch/eventsub: package for websocket eventsub
twitch/eventsub: move transport-agnostic types outside websocket hand…
twitch: add conduit subscribe
twitch/eventsub: add stream.online and stream.offline payload