- My [Twitch channel](https://www.twitch.tv/ioodyme)
- It is **HIGHLY** recommended to [secure](https://nodered.org/docs/user-guide/runtime/securing-node-red#editor--admin-api-security) your Node-RED flow (your server will be exposed to the internet) !!
- This Flow is compatible with the "regular" [Twitch API](https://dev.twitch.tv/docs/api/reference) and the following [flow](https://github.com/n3odym3/Twitch-API_Node-RED)
## Prerequisites
- [Node-RED](https://nodered.org/) running on port 443 with [HTTPS](https://nodered.org/docs/user-guide/runtime/securing-node-red#enabling-https-access) enabled OR a [Ngrock auth token](https://dashboard.ngrok.com/get-started/your-authtoken)
- Twitch [APP](https://dev.twitch.tv/console/apps/) Client ID
- [Import](https://nodered.org/docs/user-guide/editor/workspace/import-export) the [flow](https://github.com/n3odym3/Node-RED_Twitch_EventSub/blob/main/EventSub-Twitch-Flow.json)
- Edit the API Settings node with your
- Twitch client ID
- Twitch client secret
- Sub secret : a password (defined by the user) to validate the Twitch event signature
- Twitch channel
- Sub URI : your Node-RED server name or ngrock tunnel URL (Ex : https://your.domain.name or https://xxxxxxxxxxx.ngrock.io)
- Go to the Node-RED dashboard (https://your.domain.name/ui or https://xxxxxxxxxx.ngrock.io/ui)
- Generate an APP token and USER token by clicking on Auhtorize APP and Authorize USER (will requires to loggin with your Twitch account and accept the scopes)
- Optinal : you can test the validity and expiration of the Token using "Validate" nodes on the Node-RED editor