# RoomClient: id property

> The id read-only property of the RoomClient interface is the room ID, the last segment of the room's URL.

The **`id`** read-only property of the [`RoomClient`](/docs/client/room-client) interface is the ID of the room the client connects to, the last segment of its [`url`](/docs/client/room-client/url).

## Value

A string, decoded from the URL, so a room ID with a space in it has the space rather than `%20`.

## Description

The ID is the room's within its project: the room's own [`room.id`](/docs/room/room/id) is the same string. Passed to `connect()` with the page's `irt-project` meta tag, it names the same room again.

## Examples

### Remembering the last room

A player who reloads the page goes back to the room they were in.

```ts
// last-room.ts
import { connect } from "@irtio/client";

const room = await connect(localStorage.getItem("lastRoom") ?? "main");
localStorage.setItem("lastRoom", room.id);
```

## See also

- [`RoomClient.url`](/docs/client/room-client/url)
- [`Room.id`](/docs/room/room/id)
