Socket
Socket
Sign inDemoInstall

twitchwebsub

Package Overview
Dependencies
47
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    twitchwebsub

[![Sub on Twitch](https://static-cdn.jtvnw.net/jtv_user_pictures/panel-51684790-image-2c23ef005f9a4731-320-320.png)](https://www.twitch.tv/modesttim/subscribe)


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 30 Oct 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc