Skip to main content

Rooms

A room is the container for a meeting. Create one, then give its room id and a participant token to your client app to join. All room operations are on the rooms resource.

Create a room

const room = await client.rooms.create({ geoFence: "us002" });
room.roomId; // "abcd-efgh-ijkl"

Reusing a customRoomId returns the existing room instead of creating a new one, so you can key rooms to records in your own database.

OptionTypeDescription
customRoomIdstringYour own id. Creation is idempotent on it.
geoFencestringRegion to pin the room to (us002, eu001, in002, …).
webhookobjectWebhook for this room's session events (url, events).
autoCloseConfigobjectClose the session automatically after inactivity.
autoStartConfigobjectStart recording or HLS automatically when the session begins.
allowedParticipantIdsstring[]Restrict who may join.

To start recording on the first join, pass autoStartConfig:

await client.rooms.create({
autoStartConfig: {
recording: {
config: { layout: { type: "GRID" } },
transcription: { enabled: true },
},
},
});

List rooms

Returns a page you can iterate across all pages.

for await (const room of await client.rooms.list()) {
console.log(room.roomId, room.createdAt);
}

Filters: query (an exact roomId or customRoomId), plus pagination.

Get a room

const room = await client.rooms.get("abcd-efgh-ijkl");

Accepts a roomId, internal id, or your customRoomId. Errors if the room doesn't exist.

Validate a room

The same lookup as get, but it never errors on an unknown id; it returns a result you can check. Use it for ids that come from user input.

const { valid, room } = await client.rooms.validate(roomId);

End a room

Deactivates the room and ends its live session. Accepts the VideoSDK roomId, not a customRoomId.

await client.rooms.end("abcd-efgh-ijkl");

The Room object

FieldTypeDescription
roomIdstringVideoSDK room id (xxxx-xxxx-xxxx).
customRoomIdstringYour id, if set.
geoFencestringRegion.
disabledboolWhether the room has been ended.
createdAt / updatedAtstringISO timestamps.

Got a Question? Ask us on discord