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

0.1.1-test • Public • Published

TwitcEventSub

Libary for managing twitch eventsub via websocket

Usage

import { EventSub, events } from "twitchEventSub";

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

// creating event handler
const followEvent = new events.ChannelFollow((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

7

Version

0.1.1-test

License

MIT

Unpacked Size

25.1 kB

Total Files

30

Last publish

Collaborators

  • antanasga