UNPKG

@voxket-ai/voxket-live

Version:

A React widget for embedding Voxket-powered audio/video/chat experiences.

98 lines (97 loc) 3.96 kB
import { ThemeType } from '../styles'; import { AudioOrbUI } from './voxket/AudioOrb'; import { VoxketClient } from '../core/client'; import { LiveAvatarClientConfig } from '../core/liveavatar-manager'; import { VoxketError, ModalityValue } from '../types/core'; import * as React from 'react'; export type DisplayType = 'fullscreen' | 'widget' | 'popup'; export type PopupPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'; /** Content overrides for the consent screen shown before a session starts. */ export interface ConsentScreenData { heading?: string; subHeading?: string; content?: string; consentType?: string; consentVersion?: string; } export interface VoxketWidgetProps { agentId: string; participantName?: string; baseUrl: string; /** App secret (not required if authToken is provided) */ appSecret?: string; /** App ID (not required if authToken is provided) */ appId?: string; /** Pre-generated auth token from your backend (recommended for production) */ authToken?: string; className?: string; prompts?: string[]; statusMessage?: string; welcomeTitle?: string; welcomeSubTitle?: string; width?: string; height?: string; loadingText?: string; suportsChatInput?: boolean; suportsVideoInput?: boolean; suportsScreenShare?: boolean; theme?: ThemeType; onError?: (error: VoxketError) => void; onSessionStart?: (sessionId: string) => void; onSessionEnd?: (metrics: any) => void; enableSessionLogging?: boolean; onSessionLogsUpdate?: (logs: any[]) => void; onSessionMetricsUpdate?: (metrics: any) => void; modalities?: ModalityValue[]; displayType?: DisplayType; showToolExecMessage?: boolean; popupPosition?: PopupPosition; popupTriggerText?: string; onPopupToggle?: (isOpen: boolean) => void; onDisplayTypeChange?: (displayType: DisplayType) => void; voxketClient?: VoxketClient; participantMetadata?: Record<string, any>; popupModalityMode?: 'all' | 'voice' | 'chat'; popupTriggerLogoUrl?: string; headerLogo?: string; orgLogoHeight?: number; orgLogoWidth?: number; useShadowDOM?: boolean; showOrgLogo?: boolean; /** LiveAvatar FULL mode configuration — when provided, video modality uses LiveAvatar AI avatar */ liveAvatarConfig?: LiveAvatarClientConfig; /** Custom colors for the AudioOrb visualizer. */ audioOrbUI?: AudioOrbUI; /** Custom content for the consent screen shown before a session starts. */ consentScreen?: ConsentScreenData; /** When false, the consent screen is skipped and the session starts directly. Defaults to true. */ showConsent?: boolean; /** Quick action buttons shown after the first agent message in chat. Each has a display label and a message to send. */ quickActions?: Array<{ label: string; message: string; }>; /** Custom inline styles applied to each quick action button, allowing client-side CSS overrides. */ quickActionButtonStyle?: React.CSSProperties; /** * Existing Voxket session ID to join instead of creating a new one. * When provided, the SDK calls POST /api/live/sessions/{sessionId}/join * instead of POST /api/live/agent/session. * The session must already exist on the backend. */ sessionId?: string; /** * When true, an Agent Assist toggle is shown in the widget header. * Toggling ON broadcasts AGENT_ASSIST_START to LiveKit topic 'assist.event'. * Incoming suggestions on topic 'assist.suggestion' are displayed as a banner * below the header for the human agent to read. */ agentAssistEnabled?: boolean; } declare function WrappedWidget(props: VoxketWidgetProps & { prompts?: string[]; statusMessage?: string; welcomeTitle?: string; welcomeSubTitle?: string; }): import("react/jsx-runtime").JSX.Element; export default WrappedWidget;