Skip to content

tiksync/tiksync-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

TikSync Node.js SDK

TikTok Live SDK for Node.js - Real-time chat, gifts, likes, follows & viewer events.

npm License: MIT

const { TikSync } = require("tiksync");

const live = new TikSync("username", {
  apiKey: "your_api_key"
});

live.on("chat", (data) => {
  console.log(`[${data.uniqueId}] ${data.comment}`);
});

live.on("gift", (data) => {
  console.log(`${data.uniqueId} sent ${data.giftName} x${data.repeatCount}`);
});

live.connect();

Installation

npm install tiksync

Quick Start

const { TikSync } = require("tiksync");

const client = new TikSync("charlidamelio", {
  apiKey: "your_api_key"
});

client.on("connected", (state) => {
  console.log(`Connected to room ${state.roomId} (${state.viewerCount} viewers)`);
});

client.on("chat", (data) => {
  console.log(`[${data.uniqueId}] ${data.comment}`);
});

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

client.on("like", (data) => {
  console.log(`${data.uniqueId} liked (${data.totalLikeCount} total)`);
});

client.on("follow", (data) => {
  console.log(`${data.uniqueId} followed`);
});

client.on("member", (data) => {
  console.log(`${data.uniqueId} joined`);
});

client.on("streamEnd", () => {
  console.log("Stream ended");
});

client.connect();

REST API

const { TikSyncAPI } = require("tiksync");

const api = new TikSyncAPI({ apiKey: "your_api_key" });

const health = await api.health();
const usage = await api.usage();
const signed = await api.sign("username");

Events

Event Description
chat Chat messages with user info and badges
gift Gift events with diamond values and streak info
like Like events with per-user and total counts
follow New follower notifications
share Stream share events
member User join/leave events
roomUser Viewer count updates
subscribe Subscription events
streamEnd Stream end notifications
connected Connected to stream
disconnected Disconnected from stream
error Connection error

Pricing

Plan Price Requests/day WebSocket connections CAPTCHA cost
Free $0 1,000 10 $0
Pro $39/mo 15,000 50 $0
Business $99/mo 250,000 1,500 $0

Get your API key at tiksync.com

License

MIT - built by SyncLive | tiksync.com

About

TikSync Node.js SDK - TikTok Live real-time events

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors