@voxket-ai/voxket-live 1.1.113 → 1.1.115

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -73,6 +73,13 @@ export interface VoxketWidgetProps {
73
73
  }>;
74
74
  /** Custom inline styles applied to each quick action button, allowing client-side CSS overrides. */
75
75
  quickActionButtonStyle?: React.CSSProperties;
76
+ /**
77
+ * Existing Voxket session ID to join instead of creating a new one.
78
+ * When provided, the SDK calls POST /api/live/sessions/{sessionId}/join
79
+ * instead of POST /api/live/agent/session.
80
+ * The session must already exist on the backend.
81
+ */
82
+ sessionId?: string;
76
83
  }
77
84
  declare function WrappedWidget(props: VoxketWidgetProps & {
78
85
  prompts?: string[];
@@ -12,6 +12,11 @@ export interface VoxketClientConfig extends VoxketConfig {
12
12
  participantMetadata?: Record<string, any>;
13
13
  /** LiveAvatar FULL mode configuration — when provided, video modality uses LiveAvatar */
14
14
  liveAvatarConfig?: LiveAvatarClientConfig;
15
+ /**
16
+ * Existing Voxket session ID to join instead of creating a new one.
17
+ * When set, fetchConnectionDetails() calls the join endpoint instead of create.
18
+ */
19
+ sessionId?: string;
15
20
  onConnected?: () => void;
16
21
  onDisconnected?: (reason?: string) => void;
17
22
  onError?: (error: VoxketError) => void;
@@ -73,17 +78,6 @@ export declare class VoxketClient extends VoxketEventEmitter<VoxketEvents & RpcE
73
78
  metadata?: Record<string, any>;
74
79
  participantMetadata?: Record<string, any>;
75
80
  }): Promise<VoxketSession>;
76
- /**
77
- * Check microphone permission state without triggering the browser prompt.
78
- * Returns 'granted', 'denied', or 'prompt'.
79
- */
80
- checkMicrophonePermission(): Promise<'granted' | 'denied' | 'prompt'>;
81
- /**
82
- * Request microphone permission proactively (before session start).
83
- * MUST be called from a user-gesture (click handler) to re-trigger after denial.
84
- * Returns 'granted' or 'denied'.
85
- */
86
- requestMicrophonePermission(): Promise<'granted' | 'denied'>;
87
81
  endSession(): Promise<SessionMetrics | null>;
88
82
  getCurrentSession(): VoxketSession | null;
89
83
  getSessionMetrics(): SessionMetrics | null;
@@ -6,6 +6,8 @@ export interface ConnectionConfig {
6
6
  appId?: string;
7
7
  appSecret?: string;
8
8
  authToken?: string;
9
+ /** When set, fetchConnectionDetails() calls the join endpoint for this session ID */
10
+ sessionId?: string;
9
11
  }
10
12
  /**
11
13
  * ConnectionManager
@@ -35,7 +37,13 @@ export declare class ConnectionManager {
35
37
  private setupRoomEventListeners;
36
38
  addConsentLog(consentVersion: string, consentType: stirng, modalities: ModalityValue[], agentId: string, participantName: any): Promise<any>;
37
39
  /**
38
- * Fetch connection details from the server
40
+ * Fetch connection details from the server.
41
+ *
42
+ * Two paths:
43
+ * 1. Join existing session — when `this.config.sessionId` is set:
44
+ * POST /api/live/sessions/{sessionId}/join → { token, wss_url, session_id }
45
+ * 2. Create new session — default path:
46
+ * POST /api/live/agent/session → { token, wss_url, session_id, agent_info }
39
47
  */
40
48
  fetchConnectionDetails(agentId: string, participantName: string, modalities: ModalityValue[], participantMetadata?: Record<string, any>): Promise<{
41
49
  serverUrl: string;
@@ -28,19 +28,6 @@ export declare class MediaManager {
28
28
  * Ensure AudioContext is running (call before any audio operations)
29
29
  */
30
30
  ensureAudioContextRunning(): Promise<void>;
31
- /**
32
- * Check microphone permission state WITHOUT triggering browser prompt.
33
- * Uses the Permissions API to query the current state.
34
- * Returns 'granted', 'denied', or 'prompt'.
35
- */
36
- checkMicrophonePermission(): Promise<'granted' | 'denied' | 'prompt'>;
37
- /**
38
- * Request microphone permission by calling getUserMedia.
39
- * MUST be called from a user-gesture (click handler) to re-trigger
40
- * the browser permission popup even after a previous denial.
41
- * Returns 'granted' or 'denied'.
42
- */
43
- requestMicrophonePermission(): Promise<'granted' | 'denied'>;
44
31
  /**
45
32
  * Set the room instance for media management
46
33
  */
@@ -12,6 +12,7 @@ export interface RenderUIOptions {
12
12
  style?: React.CSSProperties;
13
13
  autoStart?: boolean;
14
14
  agentId?: string;
15
+ sessionId?: string;
15
16
  popupBgColor?: string;
16
17
  participantName?: string;
17
18
  displayType?: DisplayType;