# Replay: privateOf() method

> The privateOf() method of the Replay interface returns a player's private state at the tick shown, when the replay recorded it.

The **`privateOf()`** method of the [`Replay`](/docs/client/replay) interface returns a player's private state at the tick shown, when the replay recorded private state.

## Syntax

```ts
privateOf(player)
```

### Parameters

`player`
: A string: the player's ID.

### Return value

A read-only object with the private kind's fields, or `undefined` if the replay holds no private state for the player at the tick shown, including when the recording didn't record private state.

### Exceptions

None.

## Description

A room records private state only when it starts the recording with `private: true`; see [`Room.record()`](/docs/room/room/record). Such a replay shows every player's hand, so serve it only to those who may see it. The object is a copy of the values at the tick shown, so read it again after the tick changes.

## Examples

### Showing every hand after a poker game

A poker game's replay viewer shows each player's cards beside the table, read from their private state.

```ts
// hands.ts
import type { Replay } from "@irtio/client/replay";

export function hands(replay: Replay): Map<string, unknown> {
  const out = new Map<string, unknown>();
  for (const p of replay.presence) out.set(p.player, replay.privateOf(p.player)?.cards);
  return out;
}
```

## See also

- [`Replay.state`](/docs/client/replay/state)
- [`Room.record()`](/docs/room/room/record)
- [Replays and clips](/docs/room/guides/replays)
