Home

Awesome

Twitch API Wrapper

API that wraps around the Twitch Helix API to fetch current stream information.

This was made as an companion tool for AutoVOD. So currently it only returns the stream title and current game.

Limitation: The Twitch API doesn't return anything if the streamer is not live.

Endpoints

/info/<username-here>

Installation

Clone the repo

git clone https://github.com/jenslys/twitch-api-wrapper.git

CD into the folder

cd twitch-api-wrapper

Create environment file

cp .env.example .env

Install NPM packages

npm install

Environment variables

  1. Register a Twitch application and add https://localhost/ as your redirect url.

  2. Generate a new client secret.

  3. fill in TWITCH_CLIENT_ID and TWITCH_CLIENT_SECRET inside the .env file.

  4. TWITCH_AUTH_TOKEN can be generated and added with the provided curl command or you leave it empty, as it is generated on deployment if the field is empty and it is refreshed every 30 days. So once deployed, the application should be able to run without any further configuration.

  5. PORT desired port to run on. defaults to 3000 if empty.

Deploy to production

Deploy with Vercel

  1. Hit the button above.
  2. Leave everything as default.
  3. Add the required env variables as listed above on vercel.
  4. Hit deploy.