getRoomSessionById

View as Markdown

getRoomSessionById

  • getRoomSessionById(id): Promise<{ roomSession: RoomSession }>

Returns a room session given its id. Only in-progress room sessions are currently returned.

Parameters

id
stringRequired

Id of the room session.

Example

In this example, we use the getRoomSessions method to get the currently active room sessions and then use the getRoomSessionById method to get the first room session’s information. 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
9const room = await videoClient.getRoomSessionById(roomSessions[0].id);
10
11console.log(room.roomSession.displayName)

Returns

Promise<{ roomSession: RoomSession }>

A promise that resolves to a RoomSession object that can be used to access the room session’s information and methods.