witty-kangaroo-6889
08/18/2025, 12:46 AMtall-airline-16756
08/18/2025, 12:46 AMtall-airline-16756
08/18/2025, 12:46 AMlistRooms()
method from the RoomServiceClient
. Here’s a simple way to do it:
1. First, set up the RoomServiceClient: const livekitHost = '<LIVEKIT_HOST>'; // Just swap this with your LiveKit host URL
const apiKey = '<API_KEY>';
const apiSecret = '<API_SECRET>';
const svc = new RoomServiceClient(livekitHost, apiKey, apiSecret);
2. Next, call the listRooms()
method: `const rooms = await svc.listRooms();
console.log('Active rooms:', rooms);`This will give you an array of Room
objects, each with details about the active rooms.
Bonus tip: If you want to narrow down the list, you can pass an array of room names like this:
const rooms = await svc.listRooms(['room1', 'room2']);
Feel free to reach out if you want me to walk you through anything else!witty-kangaroo-6889
08/18/2025, 12:48 AMtall-airline-16756
08/18/2025, 12:49 AM