My company is currently working on a game and we have the need to check users Subsciption status to our own channel to update it in our database to give an ingame item only if the user is subscribed, and remove it when he’s not anymore.
The current workflow I am currently using is:
Users API part: The user links his twitch account with our own account system and our API checks if he is currently Subscribed, if he is, he’s given the item.
Then, we have a worker that runs every 6 horurs, and get all the subscribers of the channel, check if our users are still Subscribed or not or if they have subscribed in the meantime.
The problem here, is that’s i’m not sure it’s the best solution to do that.
I’m in need to keep the token refreshed (the token on the part of the worker) to check each time if the users are still subscribed.
Plus, it’s a very heavy operation on the Datas managed side (I have to pull all the user’s from the DB that have linked their account to check their current status).
Is this the only way to do that? Or is it another way?
That’s actually what I am doing with my worker (I construct a list of subscribers via the channel’s subscribers, and compare it to the users that have linked their accounts on the app).
I will do what you said on the user-part, by getting only the id of the user without checking directly if he is already subscribed, it seems a good idea for the scopes management.
But it answers to my question: it seems to be a good way to do it, thanks for your answer