@voxket-ai/voxket-live 1.0.144 → 1.0.146

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.
package/README.md CHANGED
@@ -357,122 +357,6 @@ client.on('connection.error', (error) => {
357
357
  });
358
358
  ```
359
359
 
360
- ## 🔔 **Custom Event System**
361
-
362
- ### 📡 **Register Event Emitters**
363
-
364
- Register custom event emitters to listen for LiveKit text stream topics:
365
-
366
- ```typescript
367
- import { VoxketClient } from '@voxket-ai/voxket-live';
368
-
369
- const client = new VoxketClient(config);
370
-
371
- // Register an event emitter for custom events
372
- client.registerEventEmitter('custom_event_topic', (data) => {
373
- console.log('Custom event received:', data);
374
- // Handle your custom business logic
375
- handleCustomEvent(data);
376
- });
377
-
378
- // Register multiple event emitters
379
- client.registerEventEmitter('user_action', (actionData) => {
380
- console.log('User action:', actionData);
381
- analytics.track('user_action', actionData);
382
- });
383
-
384
- client.registerEventEmitter('system_notification', (notification) => {
385
- showNotification(notification);
386
- });
387
- ```
388
-
389
- ### 🎯 **Event Listener Registration**
390
-
391
- Register event listeners for any SDK events with automatic cleanup:
392
-
393
- ```typescript
394
- // Register event listeners with automatic unsubscribe
395
- const unsubscribe = client.registerEventListener('chat.message.received', (message) => {
396
- console.log('New message:', message);
397
- updateUI(message);
398
- });
399
-
400
- // Manual cleanup when needed
401
- unsubscribe();
402
-
403
- // Register multiple listeners
404
- client.registerEventListener('connection.connected', () => {
405
- console.log('Connected to Voxket!');
406
- updateConnectionStatus('connected');
407
- });
408
-
409
- client.registerEventListener('agent.thinking', () => {
410
- showTypingIndicator();
411
- });
412
- ```
413
-
414
- ### 🏢 **Business Integration Examples**
415
-
416
- #### **Real-time Notifications**
417
- ```typescript
418
- // Listen for agent-triggered notifications
419
- client.registerEventEmitter('agent_notification', (data) => {
420
- // Show toast notification
421
- showToast({
422
- title: data.title,
423
- message: data.message,
424
- type: data.type
425
- });
426
- });
427
-
428
- // Listen for system updates
429
- client.registerEventEmitter('system_update', (updateInfo) => {
430
- if (updateInfo.type === 'maintenance') {
431
- showMaintenanceWarning(updateInfo.schedule);
432
- }
433
- });
434
- ```
435
-
436
- #### **Custom Analytics Integration**
437
- ```typescript
438
- // Track custom business events
439
- client.registerEventEmitter('business_event', (eventData) => {
440
- // Send to your analytics platform
441
- analytics.track(eventData.event_name, {
442
- ...eventData.properties,
443
- timestamp: new Date().toISOString(),
444
- session_id: client.getCurrentSession()?.id
445
- });
446
- });
447
-
448
- // Example: Track user interactions
449
- client.registerEventEmitter('user_interaction', (interaction) => {
450
- mixpanel.track('Voxket User Interaction', {
451
- interaction_type: interaction.type,
452
- interaction_data: interaction.data,
453
- user_id: getCurrentUserId()
454
- });
455
- });
456
- ```
457
-
458
- #### **Workflow Automation**
459
- ```typescript
460
- // Trigger business workflows
461
- client.registerEventEmitter('workflow_trigger', (workflowData) => {
462
- switch (workflowData.workflow_type) {
463
- case 'lead_qualification':
464
- triggerLeadQualificationWorkflow(workflowData.lead_data);
465
- break;
466
- case 'support_escalation':
467
- escalateToHumanAgent(workflowData.ticket_data);
468
- break;
469
- case 'appointment_booking':
470
- processAppointmentRequest(workflowData.appointment_data);
471
- break;
472
- }
473
- });
474
- ```
475
-
476
360
  ### 💬 **Chat & Messaging Events**
477
361
 
478
362
  ```javascript
@@ -882,31 +766,7 @@ await client.setAudioInputDevice(deviceId);
882
766
  await client.setVideoInputDevice(deviceId);
883
767
  ```
884
768
 
885
- ### **Event System Methods**
886
-
887
- ```typescript
888
- // Register custom event emitter
889
- client.registerEventEmitter(
890
- topic: string,
891
- handler: (data: string) => void
892
- ): void
893
-
894
- // Register event listener with cleanup
895
- client.registerEventListener<K extends keyof VoxketEvents>(
896
- eventName: K,
897
- callback: (data: any) => void
898
- ): () => void
899
-
900
- // Example usage
901
- const unsubscribe = client.registerEventListener('chat.message.received', (msg) => {
902
- console.log('Message:', msg);
903
- });
904
-
905
- // Cleanup
906
- unsubscribe();
907
- ```
908
-
909
- ### �👥 **Participant Management**
769
+ ### 👥 **Participant Management**
910
770
 
911
771
  ```typescript
912
772
  // Get participants
@@ -33,7 +33,6 @@ export interface VoxketWidgetProps {
33
33
  onPopupToggle?: (isOpen: boolean) => void;
34
34
  onDisplayTypeChange?: (displayType: DisplayType) => void;
35
35
  voxketClient?: VoxketClient;
36
- participantMetadata?: Record<string, any>;
37
36
  }
38
37
  declare function WrappedWidget(props: VoxketWidgetProps & {
39
38
  prompts?: string[];
@@ -37,14 +37,11 @@ export interface RenderUIOptions {
37
37
  welcomeTitle?: string;
38
38
  welcomeSubTitle?: string;
39
39
  loadingText?: string;
40
- /** Participant metadata to be sent with session creation */
41
- participantMetadata?: Record<string, any>;
42
40
  }
43
41
  export interface VoxketClientConfig extends VoxketConfig {
44
42
  agentId?: string;
45
43
  participantName?: string;
46
44
  modalities?: SessionModality[];
47
- participantMetadata?: Record<string, any>;
48
45
  onConnected?: () => void;
49
46
  onDisconnected?: (reason?: string) => void;
50
47
  onError?: (error: Error) => void;
@@ -71,20 +68,19 @@ export declare class VoxketClient extends VoxketEventEmitter<VoxketEvents & RpcE
71
68
  private activeTranscriptions;
72
69
  private isAgentConnected;
73
70
  private agentState;
74
- private _eventEmitters;
75
71
  constructor(config: VoxketClientConfig);
76
72
  private setupEventListeners;
77
73
  private setupRpcEventForwarding;
78
74
  private initializeClient;
79
75
  private setupRoomEventListeners;
80
76
  private setupTextStreamHandlers;
81
- fetchConnectionDetails(agentId?: string, participantName?: string, modalities?: SessionModality[], participantMetadata?: Record<string, any>): Promise<{
77
+ fetchConnectionDetails(agentId?: string, participantName?: string, modalities?: SessionModality[]): Promise<{
82
78
  serverUrl: string;
83
79
  participantToken: string;
84
80
  voxketSessionId: string;
85
81
  agentInfo?: AgentInfo;
86
82
  }>;
87
- connect(agentId?: string, participantName?: string, modalities?: SessionModality[], participantMetadata?: Record<string, any>): Promise<{
83
+ connect(agentId?: string, participantName?: string, modalities?: SessionModality[]): Promise<{
88
84
  serverUrl: string;
89
85
  participantToken: string;
90
86
  voxketSessionId: string;
@@ -96,7 +92,6 @@ export declare class VoxketClient extends VoxketEventEmitter<VoxketEvents & RpcE
96
92
  participantName?: string;
97
93
  modalities?: SessionModality[];
98
94
  metadata?: Record<string, any>;
99
- participantMetadata?: Record<string, any>;
100
95
  }): Promise<VoxketSession>;
101
96
  endSession(): Promise<SessionMetrics | null>;
102
97
  getCurrentSession(): VoxketSession | null;
@@ -220,16 +215,6 @@ export declare class VoxketClient extends VoxketEventEmitter<VoxketEvents & RpcE
220
215
  * Unregister an RPC method
221
216
  */
222
217
  unregisterRpcMethod(methodName: string): void;
223
- /**
224
- * Set participant metadata that will be sent with session creation requests.
225
- * This is useful for passing business-specific user information to the API.
226
- * @param metadata Object containing participant metadata (e.g., userId, customerType, etc.)
227
- */
228
- setParticipantMetadata(metadata: Record<string, any>): void;
229
- /**
230
- * Get the current participant metadata
231
- */
232
- getParticipantMetadata(): Record<string, any> | undefined;
233
218
  /**
234
219
  * Register a custom event listener for VoxketClient events.
235
220
  * This is a business-friendly alias for the inherited `on` method.