I run a chatbot which obviously is in multiple streams and each streamer has authenticated properly through the preferred oauth flow using refresh tokens etc ( “Authorization code grant flow”), and authorized my app, but I have reached a limit it appears when it comes to PubSub topics.
Each streamer is subscribing to 4 events (channel-points-channel-v1.4, channel-subscribe-events-v1.4, channel-bits-events-v2, following) using their own oauth tokens. The first 16 streams subscribe to their own four topics as described above just fine, but any streamer after 16 gives me the “ERR_TOO_MANY_TOPICS” when attempting to subscribe.
How do i go about getting an increased limit?
As documented in the Docs, PubSub only allows a total of 50 topic subscriptions per connection. You’re hitting this after 16 streamers (16*4 = 48). You can get ten times this limit by creating an additional PubSub connection, but i advise against this - PubSub is mainly intended for first Party use with third Party use as an afterthought - In contrast, I recommend you check out EventSub instead, as it has far greater limits (including being effectively unlimited if you have broadcaster authentication) and is intended for third party consumption from the ground up.
Note that it currently only supports a Webhook-based transport, but EventSub over WebSockets is coming soon™, as it is currently in closed beta.
Feel free to ask any questions about EventSub here or on Discord!
Also for reference
Clients can listen on up to 50 topics per connection. Trying to listen on more topics will result in an error message.
We recommend that a single client IP address establishes no more than 10 simultaneous connections.
50 topics and 10 connections is the recommendation.