Skip to content

Commit

Permalink
Tweaking the authentication notes
Browse files Browse the repository at this point in the history
  • Loading branch information
BarryCarlyon committed Nov 18, 2023
1 parent 33bf9fc commit 60f0909
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions eventsub/websockets/web/chat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,42 @@ Give it a [whirl here](https://barrycarlyon.github.io/twitch_misc/eventsub/webso

For example you are making a third party chat client, or you are a game client running from the game.

A user access token with the following scopes
Just generated user access token with the following scopes

- `user:read:chat` from the user you wish to read chat as

You then use that user access token to create subscriptions to your socket.

Thats it

### If you are using EventSub over Webhooks:

For example you are a channel bot that handles moderation

A user access token with the following scopes or permissions:
Prior generated user access token with the following scopes or permissions:

- `user:read:chat` from the user account you wish to read chat as (usually the bot)
- `user:bot` from the user account you wish to act as a bot as
- moderator status in the channel you wish to connect to

### If you are using EventSub over Webhooks:
You then ignore the user access token(s) and use an [App Access/Client Credentials](https://dev.twitch.tv/docs/authentication/getting-tokens-oauth/#client-credentials-grant-flow) token to create subscriptions to your Webhook.

### If you are using EventSub over Webhooks (more common approach):

For example you are the channel bot that just sends/reads chat, such as a game (where a control server is in use) or hydrationBot (as water bot doesn't and shouldn't be given perms)

A user access token with the following scopes or permissions:
Prior generated user access token with the following scopes or permissions:

- `user:read:chat` from the user account you wish to read chat as (usually the bot)
- `user:bot` from the user account you wish to act as a bot as
- `channel:bot` from the channel you wish to connect to

You then ignore the user access token(s) and use an [App Access/Client Credentials](https://dev.twitch.tv/docs/authentication/getting-tokens-oauth/#client-credentials-grant-flow) token to create subscriptions to your Webhook.

## Reference Documentation

For what is used in this example

- [OAuth Implicit Code Flow](https://dev.twitch.tv/docs/authentication/getting-tokens-oauth#implicit-grant-flow)
- [EventSub](https://dev.twitch.tv/docs/eventsub)
- [EventSub WebSockets](https://dev.twitch.tv/docs/eventsub/handling-websocket-events)
Expand Down

0 comments on commit 60f0909

Please sign in to comment.