Class: TwitchWebhook

TwitchWebhook(options)

Twitch Webhook API

Constructor

new TwitchWebhook(options)

Constructs an instance of TwitchWebHookAPI
Parameters:
Name Type Description
options Object Options
Properties
Name Type Attributes Default Description
client_id string Client ID required for Twitch API calls
callback string URL where notifications will be delivered.
secret string <optional>
false Secret used to sign notification payloads.
lease_seconds number <optional>
864000 Number of seconds until the subscription expires.
listen boolean | Object <optional>
Listen options
Properties
Name Type Attributes Default Description
autoStart string <optional>
true Should automaticaly starts listening
host string <optional>
"0.0.0.0" Host to bind to
port number <optional>
8443 Port to bind to
https boolean | Object <optional>
false Should use https connection. If yes, these options to be passed to `https.createServer()`.
baseApiUrl string <optional>
"https://api.twitch.tv/helix/" Base Twitch API URL. Needed proxying and testing
Source:

Members

errors

Return errors
Source:

Methods

close() → {Promise}

Stop listening for connections
Source:
Returns:
Type
Promise

isListening() → {boolean}

Check if server is listening for connections.
Source:
Returns:
Type
boolean

listen(…argsopt) → {Promise}

Start listening for connections
Parameters:
Name Type Attributes Description
args any <optional>
<repeatable>
Arguments
Source:
Throws:
If listening is already started
Type
Promise.<FatalError>
Returns:
Type
Promise

subscribe(topic, options) → {Promise}

Subscribe to specific topic
Parameters:
Name Type Description
topic string Topic name
options Object Topic options
Source:
Throws:
If hub finds any errors in the request
Type
RequestDenied
Returns:
Type
Promise

unsubscribe(topic) → {Promise}

Unsubscribe from specific topic. "*" will unsubscribe from all topics that were subscribed on this session
Parameters:
Name Type Description
topic string Topic name
Source:
Throws:
If hub finds any errors in the request
Type
RequestDenied
Returns:
Type
Promise