*** id: e75e30ba-2956-4676-87d7-ce1a1a0a5c5a title: unlock slug: /node/reference/video/room-session/unlock description: unlock method for the RoomSession class. max-toc-depth: 3 ---------------- [roomsession-41]: /docs/server-sdk/v4/node/reference/video/room-session ### unlock * **unlock**(): `Promise` Unlocks the room if it had been previously locked. This allows new participants to join the room. #### Returns `Promise` #### Example In this example, we lock a room when it starts and then unlock it after 20 seconds. This example assumes that there is a [`RoomSession`][roomsession-41] already active and users are joining it. ```js import { SignalWire } from "@signalwire/realtime-api"; const client = await SignalWire({ project: "ProjectID Here", token: "Token Here" }) const videoClient = client.video; // Setup listener for when a room starts await videoClient.listen({ onRoomStarted: async (roomsession) => { // Lock the room console.log('Locking room'); await roomsession.lock(); // unlock the room after 20 seconds setTimeout(async () => { console.log('Unlocking room'); await roomsession.unlock(); }, 20000); roomsession.listen({ onMemberJoined: async (member) => { console.log('Member joined', member.name); }, onMemberLeft: async (member) => { console.log('Member left', member.name); }, }) } }) ```