# DataClient: playerData property

> The playerData read-only property of the DataClient interface is the data of the player the client is.

The **`playerData`** read-only property of the [`DataClient`](/docs/client/data-client) interface is the data of the player the client is, kept per project across every room.

## Value

A [`PlayerData`](/docs/room/player-data), with the Room API's [`get()`](/docs/room/player-data/get), [`set()`](/docs/room/player-data/set), [`increment()`](/docs/room/player-data/increment), [`delete()`](/docs/room/player-data/delete), [`list()`](/docs/room/player-data/list) and [`refresh()`](/docs/room/player-data/refresh) methods, for this player only.

## Description

A client reads every key of its own player's data, and writes only the keys in the project's `data.player.clientWrite`; a write to any other key rejects with a `DataError` with code `E_FORBIDDEN`. Writes from a client can't use `once`, which rejects with `E_INVALID`, but `version` works as in room code.

Nothing is cached on the client, so every `get()` reads from the router and `refresh()` has nothing to drop. Without a token, the first call gets the client a guest; see [`dataClient()`](/docs/client/dataclient#description).

## Examples

### Counting games played

The client counts the player's finished games in one step, which needs `gamesPlayed` in `data.player.clientWrite`.

```ts
// games-played.ts
import { dataClient } from "@irtio/client";

const data = dataClient();

export async function finishGame() {
  const played = await data.playerData.increment("gamesPlayed");
  console.log(`games played: ${played}`);
}
```

A count that matters, such as one that unlocks a reward, belongs in room code, since a client can write any number to a key it may write.

## See also

- [`PlayerData`](/docs/room/player-data)
- [`DataClient.collection()`](/docs/client/data-client/collection)
- [Player data, collections and leaderboards](/docs/room/guides/player-data#from-a-client)
