@sanseng/liveavatar-js-sdk
v1.2.0
Published
Real-time playback SDK based on LiveKit Client with integrated WebSocket dialog communication
Readme
@sanseng/liveavatar-js-sdk
Real-time playback SDK based on LiveKit Client with integrated WebSocket dialog communication.
Overview
A TypeScript SDK for building real-time audio-video interaction applications — designed for digital human conversations, voice interactions, and similar scenarios. Built on top of LiveKit Client for media transport, with first-class support for Q&A conversation flows.
Features
- 🎙️ Real-time Audio Capture — Microphone capture with optional 3A processing (echo cancellation / noise suppression / AGC)
- 🎬 Real-time Video Playback — Remote track subscription with green screen / custom renderers
- 💬 Conversation Management — Streaming Q&A with
questionIdcorrelation, ASR transcription, answer chunking - 🔄 Auto Reconnect — Built-in retry with rate limiting and FSM-driven state restoration
- 📊 Performance Monitoring — Low-intrusion
PerformanceMonitorfor SkyWalking / OpenTelemetry / custom reporters - 🪶 Tree-Shakable — 4 bundle formats (ESM / CJS / UMD / full-UMD with LiveKit inlined)
Installation
npm install @sanseng/liveavatar-js-sdk livekit-clientQuick Start
import { createClient } from '@sanseng/liveavatar-js-sdk';
const client = createClient({
connectConfig: {
type: 'direct',
config: {
sfuUrl: '<your-sfu-url>',
userToken: '<user-token>',
},
},
video: {
containerElement: document.getElementById('video-container')!,
},
audio: {
output: { volume: 1.0, muted: false },
},
debug: true,
});
client.events.on('sdk:connected', () => {
console.log('Connected');
});Documentation
License
MIT — see LICENSE.
