2026-09-17 15:28:08 +03:00
|
|
|
# Storage — `client.storage`
|
2026-08-29 11:46:20 +03:00
|
|
|
|
2026-09-17 15:28:08 +03:00
|
|
|
Per-player storage, one item per `type`. `StorageDomain`, revision key
|
|
|
|
|
`storage`. Source: `src/domains/StorageDomain.ts`.
|
2026-08-29 11:46:20 +03:00
|
|
|
|
|
|
|
|
```ts
|
2026-09-17 15:28:08 +03:00
|
|
|
client.storage.value // GetStorageResponse | undefined
|
2026-09-29 16:43:15 +03:00
|
|
|
await client.storage.reload();
|
2026-08-29 11:46:20 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
```ts
|
|
|
|
|
interface GetStorageResponse {
|
|
|
|
|
items?: StorageItem[];
|
|
|
|
|
nextCursor?: string;
|
|
|
|
|
}
|
|
|
|
|
interface StorageItem {
|
2026-09-17 15:28:08 +03:00
|
|
|
data?: string; // opaque payload, JSON-stringify yourself
|
|
|
|
|
id?: string; // server-assigned
|
|
|
|
|
type?: string; // the storage key
|
2026-08-29 11:46:20 +03:00
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
2026-09-29 16:43:15 +03:00
|
|
|
- The client cannot write storage. Module functions (kernel `Storage.Set`) and
|
|
|
|
|
the batch admin API write it; call `reload()` after a module call that saved.
|
2026-08-29 11:46:20 +03:00
|
|
|
|
|
|
|
|
## Limits and notes
|
|
|
|
|
|
2026-09-17 15:28:08 +03:00
|
|
|
- The state loads with `{ limit: 100 }`; `nextCursor` pagination is not
|
|
|
|
|
surfaced.
|
|
|
|
|
- `data` is a raw string on the wire; serialize and parse JSON yourself.
|
|
|
|
|
- Project storage is not reachable from the client SDK. It stays available to
|
|
|
|
|
modules, the dashboard and `/game/v1`.
|