Skip to content
 
 

Repository files navigation

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");
});

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages