Pirate Tok
Docs/PirateTok documentation
PirateTok documentation

Build with PirateTok.

Connect to TikTok LIVE in your language. Understand the protocol behind every connection.

Your first connection

One room. A stream of events.

Register a handler, connect to a live account, and receive decoded messages. The library handles the WebSocket and reconnects.

npm install piratetok-live-js

JavaScript guide
JavaScript
import { TikTokLiveClient, EventType } from "piratetok-live-js";

const client = new TikTokLiveClient("username_here");
client.on(EventType.chat, (message) => {
  console.log(message.content);
});
client.on("error", console.error);

await client.connect();

Choose your language

A dedicated guide for every library.

12 libraries

Understand the connection