Skip to content

negu63/twitch-custom-notification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 

Repository files navigation

twitch-custom-notification 🔔

When a client subscribes to a streamer registered on the server,

it is a server that sends a notification through FCM according to the status.

Built to help with Twitch push notifications that sometimes don't come or come late.

Getting Started

Requirements

  • Node.js
  • Twitch API
  • Firebase (for firebase cloud messaging)
  • MongoDB (for token management)

Add .env

/server/.env

MONGODB_URI=<MongoDB_URI>
PORT=<Port number>
TWITCH_API_CLIENT_ID=<Twitch API Client Id>
TWITCH_API_BEARER_TOKEN=<Twitch API Bearer Token>
TWITCH_API_BASE_URL=https://api.twitch.tv/helix

How to get client id and bearer token ?

Add firebase service account key

/server/serviceAccountKey.json

How to get this ?

Set constants

Set live broadcast check scheduler execution cycle (second)

/server/src/constants/interval.ts

List of streamers to check live

/server/src/constants/stream.ts

Install

# /server
$ yarn install

Run

# /server
$ yarn start

API

[GET] /health

You can check if the server is running normally.

[POST] /api/token/registration

Register the fcm token generated by the client.

Request Body
{
    token: String
}

[POST] /api/token/subscribe

Set up to receive streamer notifications of listings sent by client.

Request Body
{
    token: String
    topics: String[]
}

About

FCM push notification server for twtich

Resources

Stars

Watchers

Forks