To use Event Sub scopeed topics do as follows
- Create a website with a link to create a user token,
- make sure that link has the scopes you need for the EventSub Topics you intend to call, for Channel goals this is -
channel:read:goals- as per the topic notes EventSub Subscription Types | Twitch Developers
- make sure that link has the scopes you need for the EventSub Topics you intend to call, for Channel goals this is -
- Send the broadcaster to that website
- The broadcaster logs in with Twitch
- Completely ignore the created user token
- Now create an App Access Token (no scopes needed here)
- Subscribe to event sub using the App Access Token.
Basically you need to create a link between your ClientID and the Broadcaster via Generating a user token.
Keep that user token on file in case you need to call the API
EventSub (HTTP Transport) only uses App Access Tokens.
EventSub utilises two a token approach.
As EventSub will check if your ClientID has access to the users scoped data.
Further/longer notes on this blog post I wrote How does Twitch’s new EventSub work? – Barry Carlyon