Get Moderators from a different user from the user token

I made an app where I get some infos from Twitch API, including the moderators of my Twitch channel,

When I access to my website with my Twitch account, I successfully get the moderators data displayed, but it doesn’t work when I log in my website with another Twitch account and I understand why (OAuth Token),

But I want to show who are my moderators to all users logging to my website : isn’t there a way to display these informations to every user ?

Thank you,

(docs : Reference | Twitch Developers)

Use your Token to collect the moderators into a database using a cronjob.
(And then possibly EventSub to stay up to date with changes)

Then your website will show the data from the database rather than direct API call.

1 Like

Ok I see, thank you so much

Edit : I succeeded to put my moderators into the documents of a collection of a MongoDB database but only when I accept Twitch popup with my twitch account manually. Do you have an idea of how can I automatize the database with a cronjob ? It’s possible to do a request with my twitch account with me doing it and the token expired ?

When you generate a user access token via the “normal” flow

A refresh token is retrurned.

Use the refresh token to get a new token automatically.
That will work fine until the refresh token fails for some reason, then jsut seed the system with a new access token and refresh token.

(Side note: post edit’s won’t notify of a “reply” to a post, so lucky I caught this)

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.