@vanira/sdk 0.0.23 → 0.0.25

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.
@@ -4,6 +4,8 @@ export declare class WebRTCClient {
4
4
  private serverUrl;
5
5
  private agentId;
6
6
  private callId;
7
+ private apiKey;
8
+ private backendUrl;
7
9
  private onConnected;
8
10
  private onDisconnected;
9
11
  private onError;
@@ -16,7 +18,14 @@ export declare class WebRTCClient {
16
18
  connected: boolean;
17
19
  constructor(config: WebRTCClientConfig);
18
20
  /**
19
- * Connect via HTTP signaling (no WebSocket)
21
+ * Create a call session via the Vanira API, then connect.
22
+ * Requires apiKey in the constructor config.
23
+ * Equivalent to manually calling POST /calls/create + client.connect().
24
+ */
25
+ createCall(): Promise<void>;
26
+ /**
27
+ * Connect to the agent. If apiKey is set and serverUrl is not yet resolved,
28
+ * automatically calls the pre-flight API to get call_id + worker_url first.
20
29
  */
21
30
  connect(): Promise<void>;
22
31
  /**
package/dist/types.d.ts CHANGED
@@ -20,8 +20,14 @@ export interface WidgetConfig {
20
20
  };
21
21
  }
22
22
  export interface WebRTCClientConfig {
23
- serverUrl: string;
24
23
  agentId: string;
24
+ /** Your sk_live_* or pk_live_* key. Required when using createCall(). */
25
+ apiKey?: string;
26
+ /** Override the Vanira API base URL. Defaults to https://api.vanira.io */
27
+ backendUrl?: string;
28
+ /** WebRTC worker URL. Required when calling connect() directly; set automatically by createCall(). */
29
+ serverUrl?: string;
30
+ /** Call ID. Set automatically by createCall(); supply manually if managing the session yourself. */
25
31
  callId?: string;
26
32
  onConnected?: () => void;
27
33
  onDisconnected?: () => void;