twitcheventsub.js
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

TwitcEventSub

Libary for managing twitch eventsub via websocket

Usage

import { EventSub, events } from "twitcheventsub.js";

// creating instance
const sub = new EventSub({
  auth: "YOUR_AUTHENTICATION_KEY",
});

// creating event handler
const followEvent = new events.ChannelFollow("BROADCASTER", (e) => {
  console.log("event listener", e);
});

// push event to EventSub instance
sub.subscribe(followEvent);

try {
  // start your instance
  void sub.startAsync();
} catch (e) {
  console.error(e);
}

// append extra listeners
followEvent.addEventListener(() => {
  console.log("event listener 2");
});

Readme

Keywords

Package Sidebar

Install

npm i twitcheventsub.js

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

174 kB

Total Files

190

Last publish

Collaborators

  • antanasga