Integrations
LiveKit integration (voice / video)
FluxyChat voice features use **LiveKit** as the WebRTC SFU. The Cloudflare Worker issues short-lived JWT access tokens; media runs on your LiveKit server, not o
LiveKit integration (voice / video)
FluxyChat voice features use LiveKit as the WebRTC SFU. The Cloudflare Worker issues short-lived JWT access tokens; media runs on your LiveKit server, not on Workers.
Architecture
Browser (livekit-client) ←WebRTC→ LiveKit SFU
↑ JWT token
FluxyChat Worker (POST /voice/token or dashboard voice-ai routes)- Worker: member token mint
POST /rooms/:id/voice/token(identity is the JWT user). AdminPOST /admin/calls/tokenremains. Media never runs on the Worker. - Dashboard:
/voice-aifor agent voice configuration. - Client: add
livekit-clientin React apps; connect with token from Worker.
If no LIVEKIT_* secrets are set on the Worker, both token routes answer 503 { "error": "livekit_not_configured" }. There is no stub token to connect with — configure the keys, or treat voice as unavailable in your UI.
Self-hosted LiveKit
- Deploy LiveKit server (Docker/K8s).
- Set Worker secrets:
LIVEKIT_API_KEYLIVEKIT_API_SECRETLIVEKIT_URL(wss://your-livekit.example.com)
- Token mint:
POST /admin/calls/tokenusesmintLiveKitAccessTokeninapps/worker/src/lib/livekit-token.js. - Extend client apps with
livekit-clientwhen connecting to the SFU.
React quick start
import { Room, RoomEvent } from "livekit-client";
import { useLiveKitToken } from "@fluxy-chat/react";
function VoiceRoom({ roomId, adminJwt }: { roomId: string; adminJwt: string }) {
const { token, fetchToken } = useLiveKitToken({
workerUrl: process.env.NEXT_PUBLIC_FLUXYCHAT_WORKER_URL!,
adminJwt,
roomId,
displayName: "Alice",
});
async function join() {
const creds = await fetchToken();
if (!creds?.token || !creds.url) return;
const room = new Room();
await room.connect(creds.url, creds.token);
}
return <button type="button" onClick={() => void join()}>Join voice</button>;
}LiveKit Agents (optional)
For AI voice agents, use LiveKit Agents as a separate process. FluxyChat agent runtime can hand off to an agent worker via webhook when a voice session starts.
References
- LiveKit overview
- Access tokens
- Worker stubs:
apps/worker/src/lib/video-voice.js,apps/dashboard/app/voice-ai/
Kotlin Multiplatform mobile SDK
Shared WebSocket client for Android and iOS — same protocol as `@fluxy-chat/sdk`.
Publish KMP SDK to Maven Central (Sonatype)
This guide covers **Fase 5** from [PRODUCTION-SETUP.md](/docs/operations/production-setup): getting `OSSRH_USER`, `OSSRH_PASS`, `GPG_KEY`, and `GPG_PASS` into GitHub Actio