> ## 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.

# createWebRTCClient

Creates and returns a new `WebRTCClient` instance. This is the main entry point of the SDK.

## Signature

```typescript theme={null}
import { createWebRTCClient } from '@cognigy/click-to-call-sdk';

const client = await createWebRTCClient(config: WebRTCClientConfig);
```

## Parameters

| Parameter | Type                                                                              | Description                          | Required |
| --------- | --------------------------------------------------------------------------------- | ------------------------------------ | -------- |
| `config`  | [`WebRTCClientConfig`](/click-to-call/sdk/api-reference/types#webrtcclientconfig) | Configuration object for the client. | Yes      |

## Returns

`Promise<WebRTCClient>` — a configured client instance ready to connect and make calls.

## Example

```typescript theme={null}
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

```typescript theme={null}
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' }
    ]
  }
});
```

## More Information

* [WebRTCClientConfig](/click-to-call/sdk/api-reference/types#webrtcclientconfig)
* [checkWebRTCSupport](/click-to-call/sdk/api-reference/check-click-to-call-support)
