Using this flow:
- Redirect the user to Twitch
- If they accept they are sent back to you with a
codeas a query string variable - Exchange the
codefor an access token - Use the access token
Step 1 is usually delivered via a WebPage so the user can click and go to Twitch to accept/reject the Apps access to the users account.
If you go Implicit auth, that I already linked, you can do the follow stuff via pure HTML/JS using this example as a basis
Has a live demo you can try