tiktok-live-api 1.0.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/index.d.mts +25 -0
- package/dist/index.d.ts +25 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
[](https://www.npmjs.com/package/tiktok-live-api)
|
|
7
7
|
[](https://www.typescriptlang.org/)
|
|
8
8
|
[](https://github.com/tiktool/tiktok-live-api/blob/main/LICENSE)
|
|
9
|
+
[](https://discord.gg/y8TwuFBAmD)
|
|
9
10
|
|
|
10
11
|
> This package is **not affiliated with or endorsed by TikTok**. It connects to the [TikTool Live](https://tik.tools) managed API service — 99.9% uptime, no reverse engineering, no maintenance required. Also available for [Python](https://pypi.org/project/tiktok-live-api/) and [any language via WebSocket](https://tik.tools/docs).
|
|
11
12
|
|
|
@@ -172,7 +173,7 @@ client.connect();
|
|
|
172
173
|
|
|
173
174
|
| Event | Description | Key Fields |
|
|
174
175
|
|-------|-------------|------------|
|
|
175
|
-
| `chat` | Chat message | `user`, `comment`, `emotes` |
|
|
176
|
+
| `chat` | Chat message | `user`, `comment`, `emotes`, `starred?` |
|
|
176
177
|
| `gift` | Virtual gift | `user`, `giftName`, `diamondCount`, `repeatCount` |
|
|
177
178
|
| `like` | Like event | `user`, `likeCount`, `totalLikes` |
|
|
178
179
|
| `follow` | New follower | `user` |
|
|
@@ -181,6 +182,7 @@ client.connect();
|
|
|
181
182
|
| `subscribe` | New subscriber | `user` |
|
|
182
183
|
| `roomUserSeq` | Viewer count | `viewerCount`, `topViewers` |
|
|
183
184
|
| `battle` | Battle event | `type`, `teams`, `scores` |
|
|
185
|
+
| `roomPin` | Pinned/starred message | `user`, `comment`, `action`, `durationSeconds` |
|
|
184
186
|
| `envelope` | Treasure chest | `diamonds`, `user` |
|
|
185
187
|
| `streamEnd` | Stream ended | `reason` |
|
|
186
188
|
| `connected` | Connected | `uniqueId` |
|
package/dist/index.d.mts
CHANGED
|
@@ -23,6 +23,11 @@ interface ChatEvent {
|
|
|
23
23
|
emoteId: string;
|
|
24
24
|
image: string;
|
|
25
25
|
}>;
|
|
26
|
+
/** Present only for starred (paid highlighted) chat messages. */
|
|
27
|
+
starred?: {
|
|
28
|
+
claps: number;
|
|
29
|
+
score: number;
|
|
30
|
+
};
|
|
26
31
|
}
|
|
27
32
|
/** Payload for `gift` events. */
|
|
28
33
|
interface GiftEvent {
|
|
@@ -60,6 +65,25 @@ interface BattleEvent {
|
|
|
60
65
|
teams: Array<Record<string, unknown>>;
|
|
61
66
|
scores: number[];
|
|
62
67
|
}
|
|
68
|
+
/** Payload for `roomPin` (starred/pinned message) events. */
|
|
69
|
+
interface RoomPinEvent {
|
|
70
|
+
/** User who wrote the pinned message. */
|
|
71
|
+
user: TikTokUser;
|
|
72
|
+
/** The pinned comment text. */
|
|
73
|
+
comment: string;
|
|
74
|
+
/** Pin action: 1 = pin, 2 = unpin. */
|
|
75
|
+
action: number;
|
|
76
|
+
/** How long the message stays pinned (seconds). */
|
|
77
|
+
durationSeconds: number;
|
|
78
|
+
/** Timestamp when the message was pinned (ms). */
|
|
79
|
+
pinnedAt: number;
|
|
80
|
+
/** Original message type (e.g. "WebcastChatMessage"). */
|
|
81
|
+
originalMsgType: string;
|
|
82
|
+
/** Original message ID that was pinned. */
|
|
83
|
+
originalMsgId: string;
|
|
84
|
+
/** User ID of the operator who pinned the message. */
|
|
85
|
+
operatorUserId: string;
|
|
86
|
+
}
|
|
63
87
|
/** Payload for `caption` events from {@link TikTokCaptions}. */
|
|
64
88
|
interface CaptionEvent {
|
|
65
89
|
text: string;
|
|
@@ -104,6 +128,7 @@ interface TikTokLiveEventMap {
|
|
|
104
128
|
subscribe: SocialEvent;
|
|
105
129
|
roomUserSeq: RoomUserSeqEvent;
|
|
106
130
|
battle: BattleEvent;
|
|
131
|
+
roomPin: RoomPinEvent;
|
|
107
132
|
envelope: Record<string, unknown>;
|
|
108
133
|
streamEnd: Record<string, unknown>;
|
|
109
134
|
roomInfo: Record<string, unknown>;
|
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,11 @@ interface ChatEvent {
|
|
|
23
23
|
emoteId: string;
|
|
24
24
|
image: string;
|
|
25
25
|
}>;
|
|
26
|
+
/** Present only for starred (paid highlighted) chat messages. */
|
|
27
|
+
starred?: {
|
|
28
|
+
claps: number;
|
|
29
|
+
score: number;
|
|
30
|
+
};
|
|
26
31
|
}
|
|
27
32
|
/** Payload for `gift` events. */
|
|
28
33
|
interface GiftEvent {
|
|
@@ -60,6 +65,25 @@ interface BattleEvent {
|
|
|
60
65
|
teams: Array<Record<string, unknown>>;
|
|
61
66
|
scores: number[];
|
|
62
67
|
}
|
|
68
|
+
/** Payload for `roomPin` (starred/pinned message) events. */
|
|
69
|
+
interface RoomPinEvent {
|
|
70
|
+
/** User who wrote the pinned message. */
|
|
71
|
+
user: TikTokUser;
|
|
72
|
+
/** The pinned comment text. */
|
|
73
|
+
comment: string;
|
|
74
|
+
/** Pin action: 1 = pin, 2 = unpin. */
|
|
75
|
+
action: number;
|
|
76
|
+
/** How long the message stays pinned (seconds). */
|
|
77
|
+
durationSeconds: number;
|
|
78
|
+
/** Timestamp when the message was pinned (ms). */
|
|
79
|
+
pinnedAt: number;
|
|
80
|
+
/** Original message type (e.g. "WebcastChatMessage"). */
|
|
81
|
+
originalMsgType: string;
|
|
82
|
+
/** Original message ID that was pinned. */
|
|
83
|
+
originalMsgId: string;
|
|
84
|
+
/** User ID of the operator who pinned the message. */
|
|
85
|
+
operatorUserId: string;
|
|
86
|
+
}
|
|
63
87
|
/** Payload for `caption` events from {@link TikTokCaptions}. */
|
|
64
88
|
interface CaptionEvent {
|
|
65
89
|
text: string;
|
|
@@ -104,6 +128,7 @@ interface TikTokLiveEventMap {
|
|
|
104
128
|
subscribe: SocialEvent;
|
|
105
129
|
roomUserSeq: RoomUserSeqEvent;
|
|
106
130
|
battle: BattleEvent;
|
|
131
|
+
roomPin: RoomPinEvent;
|
|
107
132
|
envelope: Record<string, unknown>;
|
|
108
133
|
streamEnd: Record<string, unknown>;
|
|
109
134
|
roomInfo: Record<string, unknown>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tiktok-live-api",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Unofficial TikTok LIVE API Client — Real-time chat, gifts, viewers, battles, and AI live captions from any TikTok livestream. Managed WebSocket API with 99.9% uptime.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|