Documentation Index
Fetch the complete documentation index at: https://docs.cognigy.com/llms.txt
Use this file to discover all available pages before exploring further.
Creates and returns a new WebRTCClient instance. This is the main entry point of the SDK.
Signature
import { createWebRTCClient } from '@cognigy/click-to-call-sdk';
const client = await createWebRTCClient(config: WebRTCClientConfig);
Parameters
| Parameter | Type | Description | Required |
|---|
config | WebRTCClientConfig | Configuration object for the client. | Yes |
Returns
Promise<WebRTCClient> — a configured client instance ready to connect and make calls.
Example
import { createWebRTCClient } from '@cognigy/click-to-call-sdk';
const client = await createWebRTCClient({
endpointUrl: 'https://your-api.com/voice-connect-config',
userId: 'user-123',
});
With Custom ICE Servers
const client = await createWebRTCClient({
endpointUrl: 'https://your-api.com/voice-connect-config',
userId: 'user-123',
pcConfig: {
iceServers: [
{ urls: 'stun:stun.l.google.com:19302' },
{ urls: 'turn:your-turn-server.com:3478', username: 'user', credential: 'password' }
]
}
});