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

network-quality-change

Prebuilt Custom Fires when the network quality assessment changes.
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().
threshold
string
deprecated
Deprecated. Use networkState instead.
quality
number
deprecated
Deprecated. Use networkState instead.
// 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,
      "..."
    }
  }
}
call.on('network-quality-change', ({ networkState, networkStateReasons }) => {
  if (networkState === 'bad') {
    showNetworkWarning(networkStateReasons);
  }
});

network-connection

Prebuilt Custom Fires when a network connection is established or interrupted. Every call uses two connections simultaneously:
  • signaling — carries call setup and management. If interrupted and not reconnected within ~20 seconds, the participant is ejected from the call.
  • 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 for details. Both reconnect automatically as long as signaling is alive.
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.
// Example: signaling connected
{
  "action": "network-connection",
  "type": "signaling",
  "event": "connected",
  "callClientId": "17225364729060.9442072768918943"
}
// Example: peer-to-peer connected
{
  "action": "network-connection",
  "type": "peer-to-peer",
  "event": "connected",
  "session_id": "123e4567-e89b-12d3-a456-426655440000",
  "callClientId": "17225364729060.9442072768918943"
}
// Example: sfu interrupted
{
  "action": "network-connection",
  "type": "sfu",
  "event": "interrupted",
  "sfu_id": "server-id",
  "callClientId": "17225364729060.9442072768918943"
}

cpu-load-change

Prebuilt Custom
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(), requesting a lower simulcast layer via updateReceiveSettings(), 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).
// Example event object
{
  "action": "cpu-load-change",
  "cpuLoadState": "low",
  "cpuLoadStateReason": "none",
  "callClientId": "17225364729060.9442072768918943"
}

test-completed

Prebuilt Custom Fires when a prejoin test completes.
Daily Prebuilt runs testCallQuality() automatically in its prejoin UI — you can listen for this event to read the results without calling it manually.
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 — see testCallQuality().
// 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