> ## Documentation Index
> Fetch the complete documentation index at: https://docs.daily.co/llms.txt
> Use this file to discover all available pages before exploring further.

# setIceConfig()

> Configures custom TURN servers for a Daily call.

`setIceConfig(iceConfig?)`

> [!NOTE]
>
> This is part of the **Advanced Firewall Control** add-on. [Contact Sales](https://www.daily.co/company/contact/sales/) to enable this feature.

Configures custom TURN servers to use instead of (or alongside) Daily's default TURN servers. Call this periodically — at least once an hour — to keep ICE credentials fresh for reconnections and new peer connections.

For best results, use TURN credentials with a validity period greater than one hour.

## Parameters

**iceServers** `RTCIceServer[]`

Array of TURN/STUN server configurations. Each entry follows the [`RTCIceServer`](https://w3c.github.io/webrtc-pc/#dom-rtciceserver) shape:

* `urls`: `string | string[]` (required): Single or multiple STUN/TURN URLs.
* `username`: `string` (optional): Username for the TURN server(s) specified.
* `credential`: `string` (optional): Credential for the TURN server(s) specified.

**placement** `'front' | 'back' | 'replace'`

Controls how custom servers are ordered relative to Daily's defaults:

* `'front'` — custom servers are tried first (default)
* `'back'` — Daily's servers are tried first
* `'replace'` — only custom servers are used

Most implementations try all servers and pick the lowest-latency option, so ordering rarely matters. Use `'replace'` only when you need to force all traffic through your own TURN servers.

**iceTransportPolicy** `'all' | 'relay'`

* `'all'` (default) uses all candidates.
* `'relay'` forces relay-only (TURN) candidates — useful for testing firewall traversal but not recommended for production.

## Return value

Returns `this` for chaining.

## Example

```javascript theme={null}
call.setIceConfig({
  iceServers: [
    {
      urls: [
        'turn:turnserver.example.org:3478?transport=udp',
        'turns:turnserver.example.org:443?transport=tcp',
      ],
      username: 'USER_NAME',
      credential: 'CREDENTIAL',
    },
  ],
  placement: 'front',
});

// Refresh credentials every hour
setInterval(() => call.setIceConfig({ iceServers: [...] }), 60 * 60 * 1000);
```

## See also

> [card] Types
>
> * [DailyCallOptions: iceConfig](https://docs.daily.co/reference/react-native/types/daily-call-options.md#param-ice-config)

> [card] Guides
>
> * [Call quality](https://docs.daily.co/docs/daily-js/guides/network-quality.md)
> * [Corporate firewalls, NATs, and allowed IP list](https://docs.daily.co/docs/guides/privacy-and-security/corporate-firewalls-nats-allowed-ip-list.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.