Skip to content

ReconnectionConfig

Configuration for automatic WebSocket reconnection with exponential backoff.

Defined in: src/core/types/config.ts:107

Configuration for automatic WebSocket reconnection with exponential backoff.

Remarks

WebSocket-based providers (e.g., DeepgramSTT, DeepgramTTS) can lose their connection due to network issues. When reconnection is enabled, the SDK automatically attempts to re-establish the connection using exponential backoff.

The delay between attempts is calculated as: min(initialDelay * backoffMultiplier ^ attempt, maxDelay)

Example

const reconnection: ReconnectionConfig = {
  enabled: true,
  maxAttempts: 5,
  initialDelay: 1000,
  maxDelay: 30000,
  backoffMultiplier: 2,
};

See

Properties

PropertyTypeDefault valueDescriptionDefined in
backoffMultiplier?number2Multiplier applied to the delay after each failed attempt. Remarks A value of 2 doubles the delay each time: 1s, 2s, 4s, 8s, …src/core/types/config.ts:150
enabledbooleantrue (via DEFAULT_RECONNECTION_CONFIG)Whether automatic reconnection is enabled.src/core/types/config.ts:113
initialDelay?number1000Initial delay before the first reconnection attempt, in milliseconds.src/core/types/config.ts:130
maxAttempts?number5Maximum number of reconnection attempts before giving up. Remarks After this many failed attempts, the SDK emits an error event and stops retrying.src/core/types/config.ts:123
maxDelay?number30000Maximum delay between reconnection attempts, in milliseconds. Remarks Caps the exponential backoff to prevent excessively long waits.src/core/types/config.ts:140

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency