leaveRoom

View as MarkdownOpen in Claude

Leave the current room.

Parameters

Returns

Promise<Record<string, unknown>> — Server response confirming the leave.

Example

1import { RelayClient } from '@signalwire/sdk';
2
3const client = new RelayClient({
4 project: process.env.SIGNALWIRE_PROJECT_ID!,
5 token: process.env.SIGNALWIRE_TOKEN!,
6 contexts: ['default']
7});
8
9client.onCall(async (call) => {
10 await call.answer();
11
12 // Join a room
13 await call.joinRoom('meeting-room-1');
14
15 // Later, leave the room
16 await call.leaveRoom();
17 await call.hangup();
18});
19
20await client.run();