# RoomClient: player property

> The player read-only property of the RoomClient interface is the player ID the client connected as.

The **`player`** read-only property of the [`RoomClient`](/docs/client/room-client) interface is the ID of the player the client connected as.

## Value

A string: the `sub` of the player token passed as `token`, or `guest:` followed by a random ID for a guest. It's `""` until the router accepts the first connection, and set by the time [`ready`](/docs/client/room-client/ready) resolves.

## Description

The player ID stays the same across reconnects. A guest keeps its ID across reloads and browser restarts too, since the client keeps the guest's token in `localStorage`; with `guest: "tab"` it's kept per tab instead. See the [Guests](/docs/guides/no-backend#guests) section of Games without a backend.

The room sees the same ID as [`connection.player`](/docs/room/connection/player). Presence entries, [`entities.ownerOf()`](/docs/client/entity-store/ownerof) and the room's messages name players by it too.

## Examples

### Marking the local player in the player list

A player list marks the local player's own entry.

```ts
// players.ts
import { connect } from "@irtio/client";

const room = await connect("main");
for (const entry of room.presence) {
  console.log(entry.player === room.player ? `${entry.name} (you)` : entry.name);
}
```

## See also

- [`RoomClient.connection`](/docs/client/room-client/connection)
- [`PresenceList.me`](/docs/client/presence-list/me)
- [Player tokens](/docs/http/player-tokens)
