TikTok Live SDK for Node.js - Real-time chat, gifts, likes, follows & viewer events.
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();npm install tiksyncconst { 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();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");| 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 |
| 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
MIT - built by SyncLive | tiksync.com