This project was created for this video tutorial on fully implementing the Twitch EventSub system. It will explain all of the finer details of how the system works as well as share additional resources. If you have any questions or feedback on how I can make this better or clearer, comment on the video above or DM me on Twitter.
If this has helped you, please consider following on the places I make things and say hi!
npm install
https://localhost:4000/redirect
src/config.json
choco install openssl
cd .\src\cert
openssl genrsa -out key.pem
openssl req -new -key key.pem -out csr.pem
localhost:4000
.openssl x509 -req -days 9999 -in csr.pem -signkey key.pem -out cert.pem
cd ..
node bot.js
<YOUR API KEY>
section with your app's Client ID. Remove the < and >.
https://id.twitch.tv/oauth2/authorize?response_type=token&client_id=<YOUR API KEY>&redirect_uri=https://localhost:4000/redirect&scope=analytics:read:extensions analytics:read:games bits:read channel:edit:commercial channel:manage:broadcast channel:manage:extensions channel:manage:polls channel:manage:predictions channel:manage:redemptions channel:manage:schedule channel:manage:videos channel:read:editors channel:read:goals channel:read:hype_train channel:read:polls channel:read:predictions channel:read:redemptions channel:read:stream_key channel:read:subscriptions clips:edit moderation:read moderator:manage:banned_users moderator:read:blocked_terms moderator:manage:blocked_terms moderator:manage:automod moderator:read:automod_settings moderator:manage:automod_settings moderator:read:chat_settings moderator:manage:chat_settings user:edit user:edit:follows user:manage:blocked_users user:read:blocked_users user:read:broadcast user:read:email user:read:follows user:read:subscriptions channel:moderate chat:edit chat:read whispers:read whispers:edit channel:read:charity moderator:read:shield_mode moderator:manage:shield_mode moderator:read:shoutouts moderator:manage:shoutouts moderator:read:followers
bot.js
and implement whatever logic you like to handle incoming events. Here's a list of events you can work with and the attributes each has.ngrok http -bind-tls=true https://localhost:4000
Forwarding
address and paste it into the ngrokURL variable found on line 18 of bot.js
.src
folder of this system and run the following command:
node bot.js