Skip to content

Notification: Twitch (automated)

agwosdz edited this page Jan 13, 2021 · 10 revisions

Hi,

I have struggled with the Twitch Notifications myself; going through the OAUTH2 Twitch Developer documentation, I was able to figure it out! In an effort to make this available in an easy automated form, I have written a script that does the leg work for you.

The first steps are identical to Jef's approach. Creating an Application from https://dev.twitch.tv/console/apps:

Must use unique name. Use https://www.uuidgenerator.net/ to get a UUID and append it to streetmerchant-.

From there, you should get the TWITCH_CLIENT_ID, TWITCH_CLIENT_SECRET, and TWITCH_CHANNEL (be careful, TWITCH_CLIENT_SECRET can only be seen one time when generated).

Add the three lines to your 'dotenv' file and save your file.

TWITCH_CLIENT_ID= TWITCH_CLIENT_SECRET= TWITCH_CHANNEL=<your twitch channel/username>

My script requires puppeteer, dotenv, readline, yesno, querystring, and node-libcurl (apologies, but this is my first NODE.js script ever), so please make sure you install the necessary dependencies

npm i puppeteer dotenv readline yesno querystring node-libcurl