getRoomSessions

View as Markdown

getRoomSessions

  • getRoomSessions(): Promise<{ roomSessions: RoomSession[] }>

Returns the currently active room sessions.

Returns

Promise<{ roomSessions: RoomSession[] }>

A promise that resolves to an array of RoomSession[] objects that can be used to access the room session’s information and methods.

Example

In this example, we get the currently active room sessions and log their names. This example assumes that you have already active RoomSession.

1import { SignalWire } from "@signalwire/realtime-api";
2
3const client = await SignalWire({ project: "ProjectID Here", token: "Token Here" })
4
5const videoClient = client.video;
6
7const { roomSessions } = await videoClient.getRoomSessions();
8
9console.log(roomSessions.forEach(room => console.log(room.name)));