Validating that a user is still connected to the app without a user token

Hi :slight_smile:

Im developing an app (bot) that requires the user to login with twitch and provide channel:bot permissions.
However, after the user has logged in with twitch, the bot no longer needs their token as it uses an app token in order to send messages in the user’s channel.

Is there a way for the bot to validate whether it still has the channel:bot permissions for the user’s channel (other than sending a message and see if it works)? or am i expected to keep maintaining user tokens and use the validate endpoint even though i dont use these tokens?

Thanks!

Without retaining the token (and refreshing if needed assuming code flow) and calling the validate endpoint either:

The relevant eventsub topics that need the scope remain working. (assuming reading chat as well as writing chat)

Or as you note making a call to the API and seeing if it succeeds or not

You could monitor the eventsub for auth.revoke and detect when a user unlinks.

1 Like