Token validation questions

My game communicates with twitch directly, not involving any third party server. This all works fine already.

I’m reading from Validating Tokens | Twitch Developers that I’m meant to validate the token every hour. This is of course no problem while my game is running, but I can’t do that when it’s not. I don’t want to take any risk getting this wrong, as the page mentions audits and punitive action.

So two questions:

1: Is my game meant to signal the twitch API to revoke the token on exit, or is it fine to leave the token alone and validate it the next time the game is launched, despite that there will be nothing to validate it hourly when it’s not running?

2: If my game is meant to revoke the token on game exit, what do I do if it can’t (e.g. the player loses internet connection before closing the game)?

No, you don’t need to revoke the token on exit.

Essentially the main point of validation in this sort of use case is to ensure that after the user connects their Twitch account to your game that the connection remains, as if a user were to stop the connection your validation process would detect that and ask them to connect with their Twitch account. Without validation it might be possible for your game to think the user is connected when in fact they’ve previously disconnected.

It’s also worth noting that if you’re actively using the API (such as periodically polling an endpoint) then that in itself is validating the token, as if the token isn’t valid then the API request will return an error. If on the other hand you only make an initial request to the API to get the users profile picture and display name and no further API requests, that’s when you would likely want to use the Validate Token endpoint periodically.

Thank you for the answer! I was definitely thinking that makes the most sense, I just absolutely didn’t want to get this one wrong.