modules
modules copied to clipboard
Add tiktok-live-nuxt
Module Info
- Name: tiktok-live-nuxt
- npm: https://www.npmjs.com/package/tiktok-live-nuxt
- Repository: https://github.com/tiktool/tiktok-live-nuxt
- Category: Integration
- Description: Nuxt module for TikTok LIVE API - real-time chat, gifts, viewers, battles & AI captions via WebSocket
Features
- Auto-imported
useTikTokLive()composable - Reactive refs for chat messages, gifts, viewer count
- SSR-safe (WebSocket connects on client hydration)
- Custom event handlers via
.on() - Config via
nuxt.config.tsorTIKTOOL_API_KEYenv var - TypeScript support with full type definitions
- Works with Nuxt 3+
Quick Example
<script setup>
const { messages, viewers, gifts, connected } = useTikTokLive('gbnews')
</script>
<template>
<div>
<p>👀 {{ viewers }} viewers</p>
<div v-for="msg in messages" :key="msg.data?.msgId">
{{ msg.data?.user?.uniqueId }}: {{ msg.data?.comment }}
</div>
</div>
</template>
Links
- Docs: https://tik.tools/docs
- npm: https://www.npmjs.com/package/tiktok-live-nuxt
- GitHub: https://github.com/tiktool/tiktok-live-nuxt
thanks for the request! you're welcome to open a pull request to list this directly; there's no need to wait on this issue.
from a fork of this repo, just run:
pnpm install
pnpm sync tiktok-live tiktool/tiktok-live-nuxt
that creates the module's .yml file in modules/. set category to one of the values in lib/categories.ts, optionally add an icon to icons/, and open a PR with resolves #1428 in the description. you can see more details in the contribution guide.