1.0.7 • Published 8 months ago

@letruxux/youtube-chat v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

@letruxux/youtube-chat

Zero dependencies, lightweight package to fetch YouTube live chat messages with no API key. Supports both history fetching and realtime messages (with polling).

Installation

npm install @letruxux/youtube-chat
bun add @letruxux/youtube-chat
pnpm add @letruxux/youtube-chat
yarn add @letruxux/youtube-chat

Usage

import {
  ChatListener,
  getYouTubeLiveVideoId,
  fetchChatMessages,
} from "@letruxux/youtube-chat";

ChatListener

const livestreamId = await getYouTubeLiveVideoId("lofigirl");
const listener = new ChatListener(livestreamId, {
  /* config */
});

listener.onMessage((message) => {
  console.log(`${message.author}: ${message.text}`);
});

listener.start();

Types

Check the definitions file.

1.0.7

8 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago