Questions about helix/bits/leaderboard

Hello, I’ve been working on a bot for a close friend of mine Evanbear1 who is a twitch partner.
This bot allows him to display Cheers, Raids, Subs, and custom messages on his lametric time, And let it as well be logged on his verified discord server.
Now I am trying to Display every once in a while the Top 3 Cheerers and gifter’s.
I’ve found the correct API for it, (helix/bits/leaderboard) but I am completely clueless to where I should get my Clientid or the required authtoken for it to work.
Could anyone explain to me how I can get a Clientid/Outhtoken that will work for Evanbear1 his streams?

Sincerly ~DutchDeveloper

The Authentication docs https://dev.twitch.tv/docs/authentication have a step by step guide, that starts with registering your application which will give you a Cilent ID and Client Secret which are used with the OAuth process.

After you’ve created an app you can use the Implicit or Authorization Code flows to get a token (the auth code flow https://dev.twitch.tv/docs/authentication/getting-tokens-oauth#oauth-authorization-code-flow will likely be best as the token can be refreshed when it expires).

1 Like

ok, need the application to be on my account or EB1’s account?

You’re the developer, so you need to register the app.

1 Like

You would generate/create the Application yourself, which gives you a clientID and Secret.

Then the streamer Evanbear1 goes to your website, clicks a login with Twitch button then grants your application access to their account.

Then you get a access_token (and refresh_token), and can use those with your ClientID to access the API on their behalf.

You’ll need the refresh token so you can automate getting a new access token when the access token expires. (So avoid implict auth, as otherwise you’ll need the streamer to grant access again in two months)

1 Like