1.0.3 • Published 7 years ago

twitchwebsub v1.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

Twitch WebSub Webhooks

Sub on Twitch


Example

$ npm install
$ CLIENT_ID=YOUR_TWITCH_CLIENT_ID_HERE node examples/run.js

Install from npm

$ npm install twitchwebsub

Usage

Create a new TwitchWebSub server object

var TwitchWebSub = require("twitchwebsub");
var WebSub = TwitchWebSub.server(options);

// Listen on port 9001
WebSub.listen(9001);
Options
KeyTypeDescription
callbackstringurl that twitch will call to get to this program
client_idstringTwitch API client id
secretstringOptional - Default :: "I hate my life and don't care if people spoof requests from Twitch."

Events

KeyParametersDescription
listenHTTP server is listening for connections.
errorerrWe've run into a problem.
denieddataSubscription request was denied by Twitch
subscribedataSuccessfully subscribed to a Topic
unsubscribedataSubscription was canceled by Twitch
feeddataTwitch sent us information about a subscription

Functions

.listen(port) - Listen for http requests on a given port
.subscribe(topic) - Subscribe to a topic
.unsubscribe(topic) - Unsubscribe from a topic
.on(event, callback) - Listen for an event from twitch

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago