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

# testNetworkConnectivity()

> Tests whether a stable WebRTC connection can be established with Daily TURN servers.

`testNetworkConnectivity(videoTrack)`

<Badge color="green">{"✓"} Prebuilt</Badge> <Badge color="green">{"✓"} Custom</Badge>

Checks whether a stable connection can be established with Daily's TURN servers. Useful for precall checks before a room is joined. The test times out automatically after 30 seconds.

<Warning>
  A passing result does not indicate that the user is authorized to join a call — only that a TURN connection is possible. A failing result does not guarantee calls will fail: P2P calls may still work.
</Warning>

## Why pass a video track?

Chrome and Firefox can test network connectivity without a media track, but Safari requires one. To ensure the test works across all browsers, `videoTrack` is required.

## Parameters

<ParamField body="videoTrack" type="MediaStreamTrack" required>
  A video track used to establish the test connection. You can obtain one from `call.participants().local.tracks.video.persistentTrack` after calling `startCamera()`.
</ParamField>

## Return value

Returns `Promise<DailyNetworkConnectivityTestStats>`.

<ResponseField name="result" type="'passed' | 'failed' | 'aborted'">
  * `'passed'` — connection to Daily's TURN servers was successful
  * `'failed'` — connection could not be established; advise users to check their network or contact their administrator
  * `'aborted'` — test was stopped via [`abortTestNetworkConnectivity()`](/reference/daily-js/instance-methods/abort-test-network-connectivity) before completion
</ResponseField>

## Example

```javascript theme={null}
await call.startCamera();
const videoTrack = call.participants().local.tracks.video.persistentTrack;

const { result } = await call.testNetworkConnectivity(videoTrack);

switch (result) {
  case 'failed':
    console.warn('Cannot connect to TURN servers. Try a different network.');
    break;
  case 'aborted':
    console.log('Test aborted.');
    break;
  case 'passed':
  default:
    console.log('Network connectivity confirmed.');
}
```

## See also

<CardGroup>
  <Card title="Methods" icon="code" iconType="solid">
    * [abortTestNetworkConnectivity()](/reference/daily-js/instance-methods/abort-test-network-connectivity)
    * [testCallQuality()](/reference/daily-js/instance-methods/test-call-quality)
  </Card>

  <Card title="Events" icon="bolt" iconType="solid">
    * [test-completed](/reference/daily-js/events/network-events#test-completed)
  </Card>
</CardGroup>
