Get id from the connected user

That gives you a code

You take the code and exchange the code for a token.

Then you can use the token with any of the twitch API’s.

Usually this endpoint:

Which if you don’t provide a ID will give you the data for the authenticating user, and optionally include email if the token you use has the right scope