As per the github I linked:
IMPORTANT
To use user tokens, you will need to set up your Client ID provided during
configurewith a redirect URI ofhttp://localhost:3000. App access tokens will work without this step. You can configure that on the Twitch Developer console.
No that is a URL you open in a browser/send the user to
This is an implict auth example that demonstrates the flow
https://barrycarlyon.github.io/twitch_misc/authentication/implicit_auth/
1 .You generate a <a href="" which would use a URL like https://id.twitch.tv/oauth2/authorize?response_type=token&client_id=<clientid>&redirect_uri=http://localhost&scope=user_read_follows
2. The user (in this case you) clicks that link accepts/declines the account link.
3. Then the user is redirected to http://localhost as the declared redirect
4. This will have a ?code= in the query string parameters.
5. You can then exchange that ?code= for an access and refresh token.
The example I linked differs at step 4: as for implict auth
- This will have a
#access_token=to extract and use
Implicit tokens cannot be refresh like a “regular” token