tiktok-live-api 1.2.8 → 1.2.11

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.
Files changed (2) hide show
  1. package/bin/demo.mjs +4 -3
  2. package/package.json +1 -1
package/bin/demo.mjs CHANGED
@@ -128,7 +128,8 @@ const VUE_TEMPLATE = [
128
128
  "",
129
129
  "let hook = null;",
130
130
  "try { if (typeof useTikTokLive !== 'undefined') hook = useTikTokLive; } catch (e) { }",
131
- "const tiktok = hook ? hook(activeUsername, { apiKey, autoConnect: false }) : { connected: ref(false), allEvents: ref([]) }",
131
+ "const proxyUsername = { replace: (r, s) => (activeUsername.value || '').replace(r, s) }",
132
+ "const tiktok = hook ? hook(proxyUsername, { apiKey, autoConnect: false }) : { connected: ref(false), allEvents: ref([]) }",
132
133
  "const connected = tiktok.connected",
133
134
  "",
134
135
  "watch(() => tiktok.allEvents.value, (all) => {",
@@ -278,13 +279,13 @@ function runScaffold(choice, targetDir, pm) {
278
279
  ' <TikTokLive />',
279
280
  ' </main>',
280
281
  '</template>'
281
- ].join('\\n') + '\\n');
282
+ ].join('\n') + '\n');
282
283
 
283
284
  const nuxtConfig = path.join(fullPath, 'nuxt.config.ts');
284
285
  if (fs.existsSync(nuxtConfig)) {
285
286
  let config = fs.readFileSync(nuxtConfig, 'utf8');
286
287
  if (config.includes('defineNuxtConfig({')) {
287
- config = config.replace('defineNuxtConfig({', "defineNuxtConfig({\\n modules: ['tiktok-live-nuxt'],\\n");
288
+ config = config.replace('defineNuxtConfig({', "defineNuxtConfig({\n modules: ['tiktok-live-nuxt'],\n");
288
289
  fs.writeFileSync(nuxtConfig, config);
289
290
  }
290
291
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiktok-live-api",
3
- "version": "1.2.8",
3
+ "version": "1.2.11",
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",