- Node and NPM
- API and OAuth keys for Twitch OR a prepopulated env file
- Clone repository
- Fill in the
.envfile - Install dependancies
npm install
- Start server
npm run server
A quick note on local testing. For the twitch webhooks to work you will need to setup a request forwarding service like ngrok.
All requests require these headers:
- Content-Type:
application/json - Authorization:
API Key
All of the api routes responed with JSON.
*The only exception to this is the create route which requires you to include the twitch username
/api/create- method:
- POST
- body:
- key:
twitch_username- value:
whatever the twitch username is
- value:
- key:
- description:
- Creates a new bot and saves it to the database. Default joined value is false.
- method:
/api/status- method:
- GET
- description:
- Gets the current status of the bot.
- method:
/api/action- method:
- PUT
- body
- key:
action- value:
join,part, orupdateUsername
- value:
- key:
- description:
- Depending on the action attribute, will either join or part the bot, or update the username in the database.
- method:
/api/delete- method:
- DELETE
- description:
- Deletes a bot from memory and the database.
- method:
/api/views- method:
- GET
- query params
- key:
fromoptional- value:
ISO date to set the lower bounds of returned streams
- value:
- key:
tooptional- value:
ISO date to set the upper bounds of returned streams
- value:
- key:
- description
- Returns all streams and associated views for the twitch id of the api key that called it. If to/from are set, only the streams between those dates will be returned
- method:
/api/admin/create- method:
- POST
- body:
- key:
twitch_userId- value:
whatever the twitch ID is
- value:
- key:
twitch_username- value:
whatever the twitch username is
- value:
- key:
- description:
- Creates a new bot and saves it to the database. Default joined value is false.
- method:
/api/admin/status- method:
- GET
- description:
- Gets the current status of all the bots.
- method:
/api/admin/status/twitch_userId- method:
- GET
- description:
- Gets the current status of the bot specified in the URL.
- method:
/api/admin/action- method:
- PUT
- body
- key:
twitch_userId- value:
whatever the twitch ID is
- value:
- key:
twitch_username- value:
whatever the twitch username is
- value:
- key:
action- value:
join,part, orupdateUsername
- value:
- key:
- description:
- Depending on the action attribute, will either join or part the bot, or update the username in the database.
- method:
/api/admin/delete- method:
- DELETE
- body:
- key:
twitch_userId- value:
whatever the twitch ID is
- value:
- key:
- description:
- Deletes a bot from memory and the database.
- method:
/api/admin/views- method:
- GET
- query params
- key:
twitch_userIds- value:
list of comma separated twitch id's
- value:
- key:
fromoptional- value:
ISO date to set the lower bounds of returned streams
- value:
- key:
tooptional- value:
ISO date to set the upper bounds of returned streams
- value:
- key:
- description
- Returns all streams and associated views for the given twitch id's. If to/from are set, only the streams between those dates will be returned
- method: