I’m following this documentation in order to get an access token that I can use with the “tmi.js” library. This library requires a username and an oauth token.
The token I will have to use it, first to get the username and then finally be able to create the tmi.js instance to connect to a channel.
What I don’t understand is that the token has expiration (I know I can generate a token at Twitch Chat Password Generator that wont expire)
You would normally NEVER EVER USE SOMEONE ELSES GENERATOR EVER FOR PRODUCTION
And create you own oAuth flow.
This lets you use code flow to get an access and refresh token.
Then you would use the refresh token to get a new access token
But the ones generated by that website last “A lot” I mean, I think I have had those oauth tokens on some accounts and they have been working for 30 days +
Wont the ones generated with the Authorization code grant flow expire after about 4 hours.
I’m guessing for this case I can use the Implicit grant flow (I though this one was short lived) but apparently no. It’s different from other platforms. In Twitch case, this one doesn’t mention any expiration at all. Which is weird.
Will experiment with the one that lasts 4 hours and see what happens after been connected 4 hours to a channel, if it still can send messages or a “re-authorization” needs to happen causing the bot to disconnect from chat missing commands during that process.