UNPKG

@airsurfer09/web-handsfree

Version:

A React package for integrating Convai's AI-powered voice assistants with LiveKit for real-time audio/video conversations

56 lines 1.81 kB
import { ConvaiClient } from "../types"; interface RTCWidgetProps { convaiClient: ConvaiClient & { activity?: string; }; apiKey: string; characterId?: string; enableVideo?: boolean; enableAudio?: boolean; url?: string; startWithVideoOn?: boolean; } /** * RTCWidget - A consolidated chat widget component for real-time conversations * * This component combines all chat UI functionality into a single, easy-to-use widget * with an expandable/collapsible interface similar to modern chat widgets. * * Features: * - Collapsed circular button with status indicator * - Expandable/collapsible chat interface * - Voice mode support * - Real-time message streaming * - Audio controls (mute/unmute) * - Settings tray with session reset * - Auto-connect on first click * * @param {RTCWidgetProps} props - Component props * @param {ConvaiClient} props.convaiClient - Convai client instance * @param {string} props.apiKey - Convai API key * @param {string} props.characterId - Character ID to connect to * @param {boolean} props.enableVideo - Enable video capability (default: false) * @param {boolean} props.enableAudio - Enable audio (default: true) * @param {boolean} props.startWithVideoOn - Start with video camera on when connecting (default: false) * @param {string} props.url - Custom Convai URL * * @example * ```tsx * function App() { * const convaiClient = useConvaiClient(); * * return ( * <RTCWidget * convaiClient={convaiClient} * apiKey="your-api-key" * characterId="360f1c86-c98a-11ef-82c5-42010a7be016" * enableVideo={true} * startWithVideoOn={false} * /> * ); * } * ``` */ export declare const RTCWidget: React.FC<RTCWidgetProps>; export {}; //# sourceMappingURL=RTCWidget.d.ts.map