I know that this question was probably set a lot of times, but I can’t figure it out with search on Google.
Is there a way to listen to follow events with the twitch API ? I mean, when a user is following the channel, then get a json response or something like that ?
Okay thank you for this precisions.
I don’t want to abuse but, how does it work ? I use JavaScript and so I have to make a POST HTTP request and wait for a user to follow ? And then when a user has follow, do I have to make an other request to wait for the next follower ?
That would be if you are long polling the Follows Endpoint.
For EventSub you need to create a Server.
That server is secured behind SSL
Then when a Follower occurs Twitch will send a HTTP Post to you. to that server
You do not have to fetch anything As Twitch will notify you when a follower occurs.
EventSub is currently a Webhooks only platform.
So you tell Twitch what topics you want via Create EventSub Subscription which is the only/single HTTP POST you will make
Then when a follow occurs, Twitch will make a HTTP Post to your Server. So you don’t have to do any fetching at all.
Since you are using JavaScript here is a NodeJS Example of an EventSub Server for recieving notifications from Twitch
Okay, I will check NGROK then and see if I can do something with it. Well, thank you very much for your reactivity and your help, I will be back, maybe