Video Client

View as Markdown

The Video Client allows you to monitor video room activity. Access it via the video property on a SignalWire Client.

1import { SignalWire } from "@signalwire/realtime-api";
2
3const client = await SignalWire({ project: "<project-id>", token: "<api-token>" });
4const videoClient = client.video;

Use getRoomSessions to list active rooms, or listen to subscribe to room events. See Events for all available events.

Examples

Listening for room events

1await videoClient.listen({
2 onRoomStarted: async (roomSession) => {
3 console.log("Room started:", roomSession.name);
4 },
5 onRoomEnded: async (roomSession) => {
6 console.log("Room ended:", roomSession.id);
7 }
8});

Getting active rooms

1const { roomSessions } = await videoClient.getRoomSessions();