From 6c7d181f14545ec2d4a90527621b93f6b827e891 Mon Sep 17 00:00:00 2001 From: Charlie Tonneslan Date: Sat, 21 Mar 2026 10:27:35 -0400 Subject: [PATCH] Improve emptyTimeout and departureTimeout JSDoc comments Clarify the behavior of emptyTimeout: it applies both before any participant joins and after all participants leave, with the timer resetting when someone joins. Also improve departureTimeout docs with a concrete use case. Fixes #126 --- packages/livekit-server-sdk/src/RoomServiceClient.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/livekit-server-sdk/src/RoomServiceClient.ts b/packages/livekit-server-sdk/src/RoomServiceClient.ts index 39097cf4..8fce3dce 100644 --- a/packages/livekit-server-sdk/src/RoomServiceClient.ts +++ b/packages/livekit-server-sdk/src/RoomServiceClient.ts @@ -38,13 +38,19 @@ export interface CreateOptions { name: string; /** - * number of seconds to keep the room open before any participant joins + * Number of seconds to keep the room open when empty. + * + * Before any participant joins, the room will close after this timeout. + * After all participants leave, the countdown restarts. If a new participant + * joins before it elapses, the timer resets and the room stays open. */ emptyTimeout?: number; /** - * number of seconds to keep the room open after the last participant leaves - * this option is helpful to give a grace period for participants to re-join + * Number of seconds to keep the room open after the last participant leaves. + * + * This provides a grace period for participants to re-join (e.g. after a + * brief disconnection) without the room being closed and recreated. */ departureTimeout?: number;