## Documentation Index

Fetch the complete documentation index at: [/llms.txt](https://docs.cognigy.com/llms.txt)

Use this file to discover all available pages before exploring further.

Connects to the SIP server and registers the client. This method fetches the SIP configuration from the endpoint URL, validates the widget is active, initializes the SIP user agent, and waits for both WebSocket connection and SIP registration to complete (with a 15-second timeout). This must be called before [`startCall()`](https://docs.cognigy.com/click-to-call/sdk/api-reference/start-call).

## Signature

```
await client.connect();
```

## Parameters

None.

## Returns

`Promise<void>`

## Throws

An error if the client has been destroyed, the configuration fetch fails, the Click To Call widget is not active, or the SIP connection or registration fails (15-second timeout).

## Example

```
await client.connect();
console.log('Connected and registered');
```

### With Error Handling

```
try {
  await client.connect();
  console.log('Connected and registered');
} catch (error) {
  console.error('Failed to connect:', error.message);
}
```

## More Information

- [disconnect](https://docs.cognigy.com/click-to-call/sdk/api-reference/disconnect)
- [connectAndCall](https://docs.cognigy.com/click-to-call/sdk/api-reference/connect-and-call)
- [startCall](https://docs.cognigy.com/click-to-call/sdk/api-reference/start-call)
- [registered](https://docs.cognigy.com/click-to-call/sdk/event-reference/registered) event

Last modified on April 21, 2026
