Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

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

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc