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

# Network events

> Events for network quality changes, connection interruptions, CPU load, and prejoin test results.

These events fire when network quality or connection state changes, when CPU load fluctuates, and when prejoin tests complete.

***

## network-quality-change

Fires when the network quality assessment changes.

> [!WARNING]
>
> As of daily-js 0.77.0, `threshold` and `quality` are deprecated in favor of `networkState` and `networkStateReasons`. Version 0.77.0 also added the `stats` bundle to the event payload.

**action** `string`

Always `"network-quality-change"`.

**callClientId** `string`

The ID of the call client instance that emitted this event.

**networkState** `string`

Current network assessment: `'good'`, `'low'`, or `'bad'`.

**networkStateReasons** `string[]`

Reasons contributing to a `'low'` or `'bad'` state. Possible values include `'sendPacketLoss'` and `'recvPacketLoss'`. Omittied if `networkState` is `'good'`.

**stats** `object`

The latest network stats bundle. Shape matches the return value of [`getNetworkStats()`](https://docs.daily.co/reference/react-native/instance-methods/get-network-stats).

**threshold** `string` *deprecated*

Deprecated. Use `networkState` instead.

**quality** `number` *deprecated*

Deprecated. Use `networkState` instead.

```json theme={null}
// Example event object
{
  "action": "network-quality-change",
  "callClientId": "17430118453690.12992179309705953",
  "networkState": "bad",
  "networkStateReasons": ["sendPacketLoss", "recvPacketLoss"],
  "stats": {
    "averageNetworkRoundTripTime": 0.01992261904761905,
    "latest": {
      "audioRecvPacketLoss": 0.15053763440860216,
      "videoSendBitsPerSecond": 1589251.349980054,
      "..."
    }
  }
}
```

```javascript theme={null}
call.on('network-quality-change', ({ networkState, networkStateReasons }) => {
  if (networkState === 'bad') {
    showNetworkWarning(networkStateReasons);
  }
});
```

***

## network-connection

Fires when a network connection is established or interrupted. Every call uses two connections simultaneously:

* **`signaling`**: a websocket connection used for call management and messaging. It retries twice before giving up; if it can't reconnect, the call ends with an [`error`](https://docs.daily.co/reference/react-native/events/error-events#error) event (`type: 'connection-error'`) followed by [`left-meeting`](https://docs.daily.co/reference/react-native/events/lifecycle-events#left-meeting). We don't recommend building reconnection logic around `signaling` interruption events for this reason.
* **`peer-to-peer`** or **`sfu`**: carries audio and video. A call uses one or the other, never both. All calls default to SFU topology, including 1:1 calls. See [P2P vs SFU calls](https://docs.daily.co/docs/guides/architecture-and-monitoring/intro-to-video-arch.md#the-architecture-of-a-room-p2p-vs-sfu-calls) for details. Both reconnect automatically as long as `signaling` is alive.

> [!NOTE]
>
> The server only removes a stale participant after about 35-40 seconds with no signal from them, so a participant may appear connected to others for a while after they've actually left. This is particularly common with Firefox, where closing the laptop lid doesn't cleanly signal that the participant has left the meeting.

**action** `string`

Always `"network-connection"`.

**callClientId** `string`

The ID of the call client instance that emitted this event.

**type** `string`

The connection type: `'signaling'`, `'peer-to-peer'`, or `'sfu'`.

**event** `string`

The connection event: `'connected'` or `'interrupted'`.

**session\_id** `string`

Present for `peer-to-peer` connections. The remote peer's `session_id`.

**sfu\_id** `string`

Present for `sfu` connections. The SFU server ID — useful for debugging and support reports.

```json theme={null}
// Example: signaling connected
{
  "action": "network-connection",
  "type": "signaling",
  "event": "connected",
  "callClientId": "17225364729060.9442072768918943"
}
```

```json theme={null}
// Example: peer-to-peer connected
{
  "action": "network-connection",
  "type": "peer-to-peer",
  "event": "connected",
  "session_id": "123e4567-e89b-12d3-a456-426655440000",
  "callClientId": "17225364729060.9442072768918943"
}
```

```json theme={null}
// Example: sfu interrupted
{
  "action": "network-connection",
  "type": "sfu",
  "event": "interrupted",
  "sfu_id": "server-id",
  "callClientId": "17225364729060.9442072768918943"
}
```

***

## cpu-load-change

> [!WARNING]
>
> The `cpu-load-change` event applies to video calls only.

Fires when the CPU load state changes. When `cpuLoadState` is `'high'`, consider lowering outgoing video quality via [`updateSendSettings()`](https://docs.daily.co/reference/react-native/instance-methods/update-send-settings), requesting a lower simulcast layer via [`updateReceiveSettings()`](https://docs.daily.co/reference/react-native/instance-methods/update-receive-settings), or reducing video subscriptions in large calls.

**action** `string`

Always `"cpu-load-change"`.

**callClientId** `string`

The ID of the call client instance that emitted this event.

**cpuLoadState** `string`

Current CPU load assessment: `'low'` or `'high'`.

**cpuLoadStateReason** `string`

The reason for the current state: `'none'` (load is low), `'encode'` (video encoding), `'decode'` (video decoding), or `'scheduleDuration'` (Daily code not completing within its scheduled interval).

```json theme={null}
// Example event object
{
  "action": "cpu-load-change",
  "cpuLoadState": "low",
  "cpuLoadStateReason": "none",
  "callClientId": "17225364729060.9442072768918943"
}
```

***

## test-completed

Fires when a prejoin test completes.

> [!NOTE]
>
> This event fires when a prejoin test method completes.

**action** `string`

Always `"test-completed"`.

**callClientId** `string`

The ID of the call client instance that emitted this event.

**test** `string`

Which test completed: `'call-quality'`, `'p2p-call-quality'`, `'network-connectivity'`, or `'websocket-connectivity'`.

**results** `object`

The test results. Shape matches the return type of the corresponding test method.

```json theme={null}
// Example: call-quality test completed
{
  "action": "test-completed",
  "test": "call-quality",
  "results": {
    "result": "good",
    "data": {
      "maxRoundTripTime": 0.247,
      "avgRoundTripTime": 0.13130370781129388,
      "avgSendPacketLoss": 0.0036800000000000014,
      "avgAvailableOutgoingBitrate": 2060985,
      "avgSendBitsPerSecond": 1778201
    },
    "id": "47dc6b22-2909-46f3-8d0f-ec1f3807046c",
    "secondsElapsed": 22
  },
  "callClientId": "17225364729060.9442072768918943"
}
```

***

## See also

> [card] Methods
>
> * [getNetworkStats()](https://docs.daily.co/reference/react-native/instance-methods/get-network-stats.md)
> * [updateSendSettings()](https://docs.daily.co/reference/react-native/instance-methods/update-send-settings.md)
> * [updateReceiveSettings()](https://docs.daily.co/reference/react-native/instance-methods/update-receive-settings.md)
> * [testPeerToPeerCallQuality()](https://docs.daily.co/reference/react-native/instance-methods/test-peer-to-peer-call-quality.md)

> [card] Guides
>
> * [Events](https://docs.daily.co/docs/daily-js/concepts/events.md)
> * [Network quality](https://docs.daily.co/docs/daily-js/guides/network-quality.md)
> * [Logging and metrics](https://docs.daily.co/docs/guides/architecture-and-monitoring/logging-and-metrics.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.