steep-shampoo-86436
02/22/2026, 9:14 AMtall-airline-16756
02/22/2026, 9:14 AMtall-airline-16756
02/22/2026, 9:14 AMdepartureTimeout in createRoom, and how to extend it so users who briefly lose internet can come back without being removed.
• The default departureTimeout is 20 seconds. This is the window a disconnected participant has to reconnect before LiveKit permanently removes them from the room.
• The emptyTimeout default is 30 seconds. That controls how long a room stays open when there are no participants (it’s separate from departureTimeout).
To give users more time to recover from a brief network drop, increase departureTimeout when creating the room. For example:
const room = await roomService.createRoom({
name: roomName,
departureTimeout: 60, // allow 60 seconds to reconnect
emptyTimeout: 300, // optional: keep room open longer when empty
});
A couple of quick notes:
• Increasing departureTimeout preserves the participant’s session/state for a longer reconnect window.
• Don’t set the timeout unnecessarily high, or room/participant cleanup may be delayed in true disconnects.
If you tell me what reconnection window you want (for example 30s, 60s, 2min), I can suggest values and any trade-offs for your use case.
Sources: Ensuring Unique Room IDs with Dynamic Room Names | LiveKitsteep-shampoo-86436
02/22/2026, 2:35 PMtall-airline-16756
02/22/2026, 2:35 PM"departureTimeout": 20.
What that webhook is telling you
• If you don’t explicitly set departureTimeout when you create the room, LiveKit uses the default of 20 seconds. The webhook shows the room’s actual runtime configuration, so seeing 20 means the room was created with the default value.
• The webhook reflects the room state at creation (or when the event fired). If you set departureTimeout after the room was created, the webhook for the original room_started event will still show whatever value was present at creation.
How to ensure your desired value appears in the webhook
1. Set departureTimeout when calling createRoom. Example:
const room = await roomService.createRoom({
name: roomName,
departureTimeout: 60, // your desired reconnect window
emptyTimeout: 300
});
1. Confirm the API call succeeds and returns the room object with departureTimeout set to your value. The room object returned by the create call should match what the webhook later reports.
2. If you update the room later via an update call, the room_started webhook won’t change retroactively — only subsequent events or a webhook triggered after the update will reflect the new value.
If you’d like, I can help troubleshoot:
• Did you include departureTimeout in the exact payload when calling createRoom?
• Can you paste the code snippet you used for createRoom (redacting secrets)? That will help me check for any typo or missing field.