> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qwacks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Player Data

> Store custom per-player documents — progression, settings, and state.

export const Scope = ({children}) => <Info>
    <b>Scope:</b> {children}
  </Info>;

**Player data** lets you persist arbitrary JSON for a player: level, coins, unlocked content,
preferences — whatever your game needs. Documents are scoped to the signed-in player.

<Scope>player data is per player; its **template** is defined per **game version**.</Scope>

A typical setup has two sides: **define the shape in the dashboard**, then **read and write it from
the SDK**.

<Tabs>
  <Tab title="Dashboard">
    A **player data template** defines the structure and defaults for a kind of document, keeping
    records consistent across players and versions. Define templates in the dashboard; players
    inherit them automatically.

    <Frame caption="Define player data templates in the dashboard.">
      <img src="https://mintcdn.com/qwacks/TGGmq_oWzDacAqHl/images/guides/player-data.png?fit=max&auto=format&n=TGGmq_oWzDacAqHl&q=85&s=930ff5bce6ffab00c232f194a89304d0" alt="Player data templates" width="1440" height="866" data-path="images/guides/player-data.png" />
    </Frame>
  </Tab>

  <Tab title="SDK">
    Run **Code Generation → Sync Schemas** in the Flock window to turn each template into a typed C#
    class, then read and write the signed-in player's document directly:

    ```csharp theme={null}
    // Read (paginates and caches the player's documents on first call)
    var progress = await FlockClient.Instance.Player.GetPlayerProgressAsync();

    // Mutate the typed object and save it back
    progress.Level = 2;
    progress.Coins += 100;
    await progress.UpdateAsync();
    ```

    The method and field names come from your template (`PlayerProgress` → `GetPlayerProgressAsync`).
  </Tab>
</Tabs>

<Tip>
  Keep documents small and purpose-scoped (e.g. a `progression` doc and a `settings` doc) rather
  than one giant blob — it makes partial updates and debugging far easier.
</Tip>
