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

# Data Management

> Choose shared data, user data, and character data.

HyperX separates data by owner and operational workflow. Decide what the data belongs to, create the required Console table if needed, then read or save it from the SDK.

## Which Feature Should I Use?

| Feature        | Owner        | Use It For                                                      |
| -------------- | ------------ | --------------------------------------------------------------- |
| Shared data    | Project      | Item catalogs, shop lists, public balance values                |
| User data      | User account | Currency, achievements, tutorial state, settings, and save data |
| Character data | Character    | Character level, equipment, stats, loadout                      |

Store account-wide settings and save data as user data. If you need a flexible JSON bundle, define an `object` field in a user data table and store the payload there.

## Read Shared Data

Shared data is created and published from Console. Clients read it. When no record ID is specified, HyperX reads the first record in the table.

```cs theme={null}
var sword = await HyperX.Core.Data.Shared.Get("catalog");
var itemRecordIds = await HyperX.Core.Data.Shared.ListRecordIds("catalog");
var specificItem = await HyperX.Core.Data.Shared.GetRecord("catalog", itemRecordIds[0]);

int price = (int)sword.Data["price"];
```

## Save User Data

```cs theme={null}
await player.PutUserData(
    "inventory",
    new { gold = 1200, gem = 30 }
);

var inventory = await player.GetUserData("inventory");
int gold = (int)inventory.Data["gold"];
```

`PutUserData` accepts POCOs, anonymous objects, and dictionaries, then serializes them with `JsonMapper`. Use `PutUserDataJson` or the `JsonData` overload when you need exact JSON text or tighter Unity AOT control.

```cs theme={null}
await player.DeleteUserData("inventory");
```

When no record ID is specified, HyperX reads or saves the first record in the user data table.

## Save Multiple Records

For tables that need multiple records, HyperX generates the record ID. Store the returned `RecordId` to read that record later, or list the current user's record IDs in the table.

```cs theme={null}
var save = await player.CreateUserData(
    "save_state",
    new { payload = new { chapter = 3, checkpoint = "forest" } }
);

var recordIds = await player.ListUserDataRecordIds("save_state");

var loaded = await player.GetUserDataRecord(
    "save_state",
    save.RecordId
);
```
