Skip to content

Authorizing within Twitch

In order for starting to develop your application over EventSub you will need the proper authorization within Twitch.

If your aim is to develop an application based on a WebSocket connection you will need to generate an user token with valid scopes for the events you are going to listen.

As you use an user token you will be only able to subscribe to events which the user of the token is the main target.

For example, we have two users, User A and B. If you have the user token from User A you can subscribe to events such as ChannelSubscribe from User A but not from User B. However, some events need a moderatorId. Consequently, the user of the token has to be the same as the moderatorId user. This means that if User A is a moderator of User B’s channel you will be able to subscribe to events which needs a moderatorId such as ChannelFollow

For further information about how to generate an user token you can see the full example in the chatbot guide and adapt it for your needs.

If your aim is to develop an application based on Webhooks or Conduits you will only need to generate an app token. For subscribing to events which need scopes and authorization from an user you will need the user to be authorized within your app with valid scopes.