npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tiktok-live-api-npm

v1.0.0

Published

TikTok LIVE API for Node.js - real-time WebSocket chat, gifts, likes, viewers, battles + AI live captions. Managed signing, no sign server.

Readme

TikTok LIVE API for Node.js

The managed TikTok LIVE API for Node.js and TypeScript. Connect to any TikTok LIVE stream over a single WebSocket and receive real-time chat messages, gifts, likes, follows, viewer counts, shares and battle events - plus AI live captions with 60+ language translation. Managed signing works out of the box: no third-party sign server, no keys to configure. Powered by the TikTool managed API.

Docs and dashboard: tik.tools  |  WebSocket API: tik.tools/websocket

npm TypeScript License

This is the same client as the tiktok-live-api package, published under a search-friendly name. It re-exports the client, REST helper, captions client and every public type unchanged, and depends on tiktok-live-api so it always tracks the upstream release. If you are starting fresh you can install either name - the API is identical.

Not affiliated with or endorsed by TikTok. It connects to the TikTool Live managed API service - no reverse engineering, no sign server to maintain. Also available for Python and any language via WebSocket.

Install

npm install tiktok-live-api-npm
# or with yarn / pnpm / bun
yarn add tiktok-live-api-npm
pnpm add tiktok-live-api-npm
bun add tiktok-live-api-npm

Quick Start

import { TikTokLive } from 'tiktok-live-api-npm';

const client = new TikTokLive('streamer_username', { apiKey: 'YOUR_API_KEY' });

client.on('chat', (event) => {
  console.log(`${event.user.uniqueId}: ${event.comment}`);
});

client.on('gift', (event) => {
  console.log(`${event.user.uniqueId} sent ${event.giftName} (${event.diamondCount} diamonds)`);
});

client.on('like', (event) => {
  console.log(`${event.user.uniqueId} liked (total: ${event.totalLikes})`);
});

client.on('follow', (event) => {
  console.log(`${event.user.uniqueId} followed`);
});

client.on('roomUserSeq', (event) => {
  console.log(`${event.viewerCount} viewers watching`);
});

client.connect();

Get a free API key at tik.tools. The key can also be supplied through the TIKTOOL_API_KEY environment variable.

Events

Register handlers with client.on(event, handler). Every payload is fully typed.

| Event | Fires when | | --- | --- | | chat | A viewer sends a chat message | | gift | A gift is sent (with diamond value and combo state) | | like | A viewer likes the stream | | follow | A viewer follows the creator | | share | A viewer shares the stream | | member | A viewer joins the room | | roomUserSeq | The viewer count updates | | battle | A LIVE Match / battle event (armies, scores, timers) | | connected | The WebSocket connects | | disconnected | The stream ends or the socket closes | | error | A connection or protocol error occurs |

REST client

The package also exports TikTool, a typed REST client for the tik.tools HTTP API - live status, rankings and leaderboards, gift catalogs, profiles, live analytics and more.

import { TikTool } from 'tiktok-live-api-npm';

const api = new TikTool({ apiKey: 'YOUR_API_KEY' });

const live = await api.isLive('streamer_username');
const board = await api.leaderboard({ region: 'US+' });
const recruits = await api.eligibleCreators({ region: 'US+', limit: 50 });

AI live captions

TikTokCaptions streams real-time speech-to-text with translation into 60+ languages, including speaker labels.

import { TikTokCaptions } from 'tiktok-live-api-npm';

const captions = new TikTokCaptions('streamer_username', {
  apiKey: 'YOUR_API_KEY',
  translateTo: 'en',
});

captions.on('caption', (event) => console.log(event.text));
captions.on('translation', (event) => console.log(event.translated));

captions.connect();

Why tik.tools

The premium managed alternative for TikTok LIVE data. What you get out of the box:

  • Managed signing infrastructure. Signing runs on our servers and works immediately - no third-party sign server to run, no separate key to configure.
  • AI live captions and translation. Real-time speech-to-text with 60+ language translation and speaker labels.
  • Unreal Engine plugin. Drive avatars, overlays and gameplay directly from live chat, gifts and battles.
  • Agency and leaderboard intelligence. Gifter leaderboards, gaming and creator ranks across regions, and eligible-creator discovery. See tiktok-live-api-ranks for the public rankings client.
  • Multi-language SDKs. First-class Node.js and Python clients plus a plain WebSocket API for any language.
  • Free Sandbox tier. Start building for free, upgrade only when you need higher limits or unmasked data.

TypeScript

Types ship with the package. TikTokLiveEventMap maps each event name to its payload type, so client.on('gift', ...) gives you a fully typed GiftEvent.

License

MIT - see LICENSE.