🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

twitchpub

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twitchpub

With this package, you can subscribe to Twitch Topics like Channel Points.

1.0.1
latest
npm
Version published
Maintainers
1
Created
Source

Twitch Pub

With this package, you can subscribe to Twitch Topics like Channel Points.

Installation Info

npm install twitchpub

Topics

channel-bits
channel-points
channel-subscriptions
channel-bits-badge
chat-moderatoractions,whispers

Getting started


const TwitchPubSub = require("twitchpub");

const PubSub = new TwitchPubSub({
oauth: "OAUTH TOKEN",
subscriptions: [
{
topic:
"TOPIC (channel-bits,channel-points,channel-subscriptions,channel-bits-badge,chat-moderatoractions,whispers)",
channel: "CHANNEL ID",
},
],
});

PubSub.on("connected", () => {
console.log("PubSub connected");
PubSub.subscribe('channel-subscriptions', 'CHANNEL ID');
});

PubSub.on("error", (error) => console.log(error));

PubSub.on("message", (msg) => {
console.log(msg);
});

Constructor

oauth: OAuth Token (with needed Scopes), subscriptions: { topic: TOPIC, channel: channelID }

Events

connected

Called when connected to PubSub.

error

Called when a error occurs.

message

Called when PubSub sends a message.

Functions

subscribe

Parameters:

  • Topic
  • Channel

License

This Project is licensed under the MIT License, read more in the License file.

This Package was built by Robin Klein.

Keywords

twitch

FAQs

Package last updated on 19 Aug 2020

Did you know?

Socket

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