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

# preflight

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

```ts
preflight(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**

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

Preflight options (duration, skipMediaTest, device overrides). See [`PreflightOptions`](/docs/browser-sdk/v4/reference/interfaces/preflight-options).

## **Returns**

`Promise<PreflightResult>`

A [`PreflightResult`](/docs/browser-sdk/v4/reference/interfaces/preflight-result) describing connectivity health.

## **Examples**

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