Skip to content

Repository files navigation

Twitch Hooks

Simple self-hosted client that takes in Twitch EventSub websocket requests and sends out Discord webhook requests

Self Hosting

VPS

Requirements

  • NodeJS 24.x or higher
  • An account for chat access (your broadcaster account works, though you can also make an alt)
  • A Twitch dev app
  • Twitch tokens using your dev app's client ID and secret
  • A bit of knowledge about SQLite

Environment

The current example.env looks like this:

CLIENT_ID= # your twitch dev app's ID
CLIENT_SECRET= # your twitch dev app's secret
CALLBACK_URL= # redirect url in your twitch dev app

CHANNEL_NAME= # your channel's username
USER_ID= # your channel's user ID
BOT_USERNAME= # chat bot username, optional

DISCORD_HOOK= # your discord webhook url

This app uses the server-sent events API for communicating between the frontend and backend. Previously we used websockets via socket.io, which NginX had issues with. This version should do better now thankfully!

Steps

  1. Clone this repo to your host
  2. Copy the example.env, rename to .env, and supply the correct info
  3. Run npm install to install dependencies
  4. Grab an access token and refresh token from https://twitchtokengenerator.com, insert them into the db.sqlite.example where relevant (see: users table), and rename it to just db.sqlite
  5. Configure anything else you need to keep the client running on a VPS/computer
  6. Run node index to get it up and running

If you have an alt account, you can test that it's working by following your main and making sure that the webhook runs. If it's working, then you're all set! The app handles everything necessary for staying subscribed to events, so you can just leave it running for whenever you stream

Support

If you need support, feel free to open an issue! However, please note that we can not provide support related to hosting- we can only help if something directly related to the program breaks

If you'd like to support us, we've got a Patreon and a Ko-Fi you can chuck some money at, if you're interested. No pressure though 🧡

About

Simple Twitch websocket/eventsub -> Discord webhook client

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages