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

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

<ParamField body="iceServers" type="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.
</ParamField>

<ParamField body="placement" type="'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.
</ParamField>

<ParamField body="iceTransportPolicy" type="'all' | 'relay'">
  * `'all'` (default) uses all candidates.
  * `'relay'` forces relay-only (TURN) candidates — useful for testing firewall traversal but not recommended for production.
</ParamField>

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

<CardGroup>
  <Card title="Types" icon="t" iconType="solid">
    * [DailyCallOptions: iceConfig](/reference/react-native/types/daily-call-options#param-ice-config)
  </Card>

  <Card title="Guides" icon="book-open" iconType="solid">
    * [Call quality](/docs/daily-js/guides/network-quality)
    * [Corporate firewalls, NATs, and allowed IP list](/docs/guides/privacy-and-security/corporate-firewalls-nats-allowed-ip-list)
  </Card>
</CardGroup>
