preflight

View as MarkdownOpen in Claude
1preflight(destination, options?): Promise<PreflightResult>

Runs a multi-phase connectivity test against the given destination.

The test checks:

  1. Signaling — WebSocket connected, RTT measurement
  2. Devices — getUserMedia succeeds with selected (or specified) devices
  3. ICE/TURN — gathers ICE candidates to verify STUN/TURN reachability
  4. Media/bandwidth (unless skipMediaTest) — dials the destination, collects getStats() for duration seconds, computes bandwidth estimates

Parameters

destination
stringRequired

A destination to dial for the media test (e.g. '/private/network-test').

options
PreflightOptions

Preflight options (duration, skipMediaTest, device overrides). See PreflightOptions.

Returns

Promise<PreflightResult>

A PreflightResult describing connectivity health.

Examples

1const result = await client.preflight('/private/network-test', { duration: 5 });
2if (!result.ok) console.warn('Connectivity issues:', result.warnings);