I used the Twitch CLI to generate a user access token, and after the call I see that the token expires in three hours after the generation.
It is way to short for me, is there anything that we can do to increase the lifetime of the token ?
I saw that there is a refresh token so maybe I can deal that problem with this token, but I really don’t know how it works.
Since I will be on my stream when I will use my application, I don’t want to pause what I do in my stream and refresh the token with the CLI and then go back to my stream, you know.
For my application, I will need to read and send chat messages.
And also I would like to listen to Events on my stream (user follow, subscriptions, raid, etc). This part is managed by the Websocket connexion right ?
Oh great so I don’t need to refresh the token for the Websocket ? I just need to put all the informations that I need and then event if the token expires, the websocket will still work ? But if I restart my application and my Websocket connexion, I will have to get a non expired token right ?
So what is the best option ? I wanted the same functionnalities as the Streamlabs Dashboard (notifications when follow, sub, raid, host, etc.).
What I wanted is to get a JSON response with all the information about the notification each time that there is an event on my stream, and then handle the rest to display it on my stream with JS/HTML/CSS.
So for that I can’t use the Websocket connexion because you said earlier that this one can’t handle follow events.
So if I get it, for my case, it’s better to use Webhook for testing purposes (when i use my application localy) and the Websocket for production use (when I use my application on my stream). Is that correct ?
And for testing when a user has follow my channel, I can use the Webhook right ?