> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# ClientPreferences

> Public preferences API for configuring SDK behavior.

`ClientPreferences` is the central knob panel for every tunable runtime
default in the SDK — connection timeouts, ICE behavior, default media
constraints, codec preferences, recovery thresholds, persisted device
selections, and UX defaults like auto-mute-on-hidden. The single instance is
owned by [`SignalWire`](/docs/browser-sdk/v4/reference/signalwire) and reached
as
[`client.preferences`](/docs/browser-sdk/v4/reference/signalwire#preferences);
applications never construct it directly.

Each preference is exposed as a paired getter/setter accessor — setting it
applies immediately and affects subsequent operations (e.g. setting
[`reconnectDelayMax`](/docs/browser-sdk/v4/reference/client-preferences/reconnect-delay-max)
changes the next reconnect attempt's back-off). All time-based preferences
take seconds, not milliseconds.

By default, preferences live only in memory for the current session. Calling
[`enableSavePreferences`](/docs/browser-sdk/v4/reference/client-preferences/enable-save-preferences)
with a [`Storage`](/docs/browser-sdk/v4/reference/interfaces/storage)
loads any persisted values on startup and writes back to storage on every
subsequent change — survive page reload and tab restore without
re-configuring on each session.

## **Constructors**

### Constructor

```ts
new ClientPreferences(): ClientPreferences
```

## **Accessors**

Whether to auto-mute video when the tab becomes hidden.

Whether to check peer connection health when the page becomes visible.

WebSocket connection timeout in seconds.

Default audio track constraints applied when no explicit constraints are provided.

Default video track constraints applied when video is enabled without explicit constraints.

Bitrate in kbps below which video is automatically disabled.

Bitrate in kbps above which video is automatically re-enabled.

Debounce time for device change events, in seconds.

Polling interval for device enumeration, in seconds.

Whether to filter out UDP-based ICE servers.

Whether automatic video degradation on low bandwidth is enabled.

Whether browser network change detection (online/offline) is enabled.

Whether relay-only escalation is enabled as a last-resort recovery tier.

Whether server-sent media-timeout hangups are intercepted for recovery.

Timeout for individual ICE candidate gathering, in seconds.

Grace period before treating ICE 'disconnected' as failure, in seconds.

Timeout for the entire ICE gathering phase, in seconds.

Timeout for a single ICE restart attempt in seconds.

Custom ICE servers for TURN/STUN configuration.

Default audio input track constraints.

Default video input track constraints.

Keyframe burst window duration in milliseconds.

Cooldown period in ms after keyframe burst limit is reached.

Maximum keyframe requests in a burst window.

Maximum recovery attempts before giving up.

Whether device selections are persisted to storage.

Preferred audio codecs in priority order.

Preferred audio input device for new calls.

Preferred audio output device for new calls.

Preferred video codecs in priority order.

Preferred video input device for new calls.

Whether to receive remote audio by default.

Whether to receive remote video by default.

Timeout for reconnecting to previously attached calls, in seconds.

Maximum reconnection backoff delay in seconds.

Minimum reconnection backoff delay in seconds.

Cooldown period between recovery attempts in seconds.

Recovery signal debounce window in seconds.

Whether to re-enumerate devices when the page becomes visible.

Minimum time in ms between re-INVITE attempts.

Maximum re-INVITE attempts per call.

Timeout in ms for a single re-INVITE attempt.

Custom relay host URL. Empty string uses the default.

Whether to force TURN relay-only ICE candidates.

Number of baseline samples for stats monitoring.

Number of seconds of metrics history to retain.

Multiplier for jitter spike detection relative to baseline.

Duration in ms with no inbound packets before a critical issue is emitted.

Packet loss fraction threshold (0-1) for issue detection.

Stats polling interval in milliseconds.

Multiplier for RTT spike detection relative to baseline.

Whether stereo Opus is enabled globally.

Whether device changes are auto-applied to active calls.

Custom user variables attached to calls.

## **Methods**

Enables persistence of preferences to storage. Loads any previously saved preferences and syncs future changes.