This is a simple express application that interacts with the Twitch API in order to fetch basic data about live videos and streamers. It can also ask for eventsub web-hooks in order to get Twitch notifications when a streamers goes online (starts streaming) or offline (stops streaming).
When Twapp asks to receive the notifications of a streamer, then this particular streamer will be consisdered monitored. In fact, this application works in strict relation with a monitoring app which will start/stop monitoring a stream activity when the streamer goes online/offline.
Here are the main features of Twapp (when working together with Twonitor):
- Search for a streamer
- Get basic details about a streamer (number of followers, description, profile picture, etc.)
- Start monitoring a new streamer
- Get details about the monitored streams of a streamer
- Get the events of a monitored stream (raids, subscriptions, most used chat words)
- List all of Twitch active web-hook subscriptions
- You can also fetch Twitch emotes
First of all clone the repo and then run:npm install
And then you must set up the ENV variables (you can take a look at an example here).
A running MongoDB instance is also necessary in order to retrieve the data of the monitored streamers, which are being saved inside the database by the Twonitor app. It is necessary for the Twonitor app to have its own WEBHOOK_SECRET (this is available from your Twitch Dev console) and to listen for notifications at the WEBHOOK_CALLBACK URL.
In fact, Twapp will ask Twitch to send the notifications at the WEBHOOK_CALLBACK URL.
Finally, you can run the app by running: npm start
You can find the full API documentation here.