@tiktool/live 2.5.0 → 2.5.2
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 +5 -6
- package/dist/index.js +2 -1246
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -1275
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
|
|
3
1
|
# @tiktool/live
|
|
4
2
|
|
|
5
3
|
### Connect to any TikTok LIVE stream in 4 lines of code.
|
|
@@ -13,8 +11,6 @@ Real-time chat, gifts, viewers, battles, follows & 18+ event types from any TikT
|
|
|
13
11
|
|
|
14
12
|
[Quick Start](#-quick-start) · [Events](#-events) · [API](#-api-reference) · [Rate Limits](#-rate-limits) · [Get API Key](https://tik.tools)
|
|
15
13
|
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
14
|
---
|
|
19
15
|
|
|
20
16
|
## ⚡ Quick Start
|
|
@@ -123,7 +119,7 @@ live.on('event', (event) => {
|
|
|
123
119
|
| `uniqueId` | `string` | — | TikTok username (without @) |
|
|
124
120
|
| `apiKey` | `string` | — | **Required.** API key from [tik.tools](https://tik.tools) |
|
|
125
121
|
| `signServerUrl` | `string` | `https://api.tik.tools` | Sign server URL |
|
|
126
|
-
| `
|
|
122
|
+
| `agent` | `http.Agent` | — | HTTP agent for proxying connections |
|
|
127
123
|
| `autoReconnect` | `boolean` | `true` | Auto-reconnect on disconnect |
|
|
128
124
|
| `maxReconnectAttempts` | `number` | `5` | Max reconnect attempts |
|
|
129
125
|
| `heartbeatInterval` | `number` | `10000` | Heartbeat interval (ms) |
|
|
@@ -264,11 +260,14 @@ Route all connections through an HTTP proxy. Works with any HTTPS proxy provider
|
|
|
264
260
|
|
|
265
261
|
```typescript
|
|
266
262
|
import { TikTokLive } from '@tiktool/live';
|
|
263
|
+
import { HttpsProxyAgent } from 'https-proxy-agent';
|
|
264
|
+
|
|
265
|
+
const agent = new HttpsProxyAgent('http://user:pass@proxy.example.com:1234');
|
|
267
266
|
|
|
268
267
|
const live = new TikTokLive({
|
|
269
268
|
uniqueId: 'streamer_name',
|
|
270
269
|
apiKey: 'YOUR_API_KEY',
|
|
271
|
-
|
|
270
|
+
agent,
|
|
272
271
|
});
|
|
273
272
|
|
|
274
273
|
await live.connect(); // Both HTTP and WebSocket go through the proxy
|