Files
rudder-js-sdk/skills/rudder-web-sdk/reference/storage.md
T
edmand46 aa9d9800c9
CI / check (push) Successful in 15s
CI / publish (push) Has been skipped
docs: README, CHANGELOG and skill for @rudder/sdk 0.1.0 with generated module clients
2026-09-17 15:28:08 +03:00

1.1 KiB

Storage — client.storage

Per-player storage, one item per type. StorageDomain, revision key storage. Source: src/domains/StorageDomain.ts.

client.storage.value   // GetStorageResponse | undefined
await client.storage.save(type, data);
await client.storage.delete(type);
interface GetStorageResponse {
  items?: StorageItem[];
  nextCursor?: string;
}
interface StorageItem {
  data?: string;   // opaque payload, JSON-stringify yourself
  id?: string;     // server-assigned
  type?: string;   // the storage key
}
  • save(type: string, data: string): Promise<void>: upserts the item of type (the server keeps one item per player and type), then invalidates.
  • delete(type: string): Promise<void>: deletes the item of type, then invalidates.

Limits and notes

  • 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.