feat!: balances and items replace the wallet in the player profile
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: rudder-web-sdk
|
||||
description: Use when working with the Rudder TypeScript/JavaScript client SDK (@rudder/sdk) for web games. Covers createClient, device/google/apple/custom auth, identity linking, state objects (player with wallets and counters, catalog, storage), module calls through clients generated by `rudder client generate`, idempotent retries, and error handling. Load this whenever code imports from @rudder/sdk or a generated rudder.modules.ts.
|
||||
description: Use when working with the Rudder TypeScript/JavaScript client SDK (@rudder/sdk) for web games. Covers createClient, device/google/apple/custom auth, identity linking, state objects (player with balances and items, catalog, storage), module calls through clients generated by `rudder client generate`, idempotent retries, and error handling. Load this whenever code imports from @rudder/sdk or a generated rudder.modules.ts.
|
||||
---
|
||||
|
||||
# Rudder Web SDK (@rudder/sdk)
|
||||
@@ -75,7 +75,7 @@ refresh clears tokens and emits `signed-out`. Details:
|
||||
| Area | Access | Kind |
|
||||
|---|---|---|
|
||||
| Auth | `client.auth` | service |
|
||||
| Player | `client.player` (`player`, `identities`, `wallets`, `counters`) | `SyncedState<PlayerProfile>` |
|
||||
| Player | `client.player` (`player`, `identities`, `balances`, `items`) | `SyncedState<PlayerProfile>` |
|
||||
| Catalog currencies | `client.catalog` | `SyncedState<Map<string, CatalogCurrency>>` |
|
||||
| Player storage | `client.storage` + `.save(type, data)` / `.delete(type)` | `SyncedState<GetStorageResponse>` + mutations |
|
||||
| Modules | `client.modules.call<T>(module, fn, args?, { moduleVersion? })` | resolves to `result` as `T` |
|
||||
@@ -116,7 +116,7 @@ and commit it when installed modules change. Details:
|
||||
revision poll (`GET /sdk/v1/sync`, keys `profile`, `catalog`, `storage`) runs
|
||||
every 30 s (±20% jitter), pauses while the tab is hidden, and reloads the
|
||||
states whose revision grew. Storage mutations invalidate immediately. Call
|
||||
`player.reload()` after a module call that changes wallets or counters when
|
||||
`player.reload()` after a module call that changes balances or items when
|
||||
you need fresh values right away.
|
||||
|
||||
## Errors
|
||||
@@ -137,6 +137,6 @@ timeout a 504, both without details.
|
||||
## Reference files
|
||||
|
||||
- [reference/auth.md](reference/auth.md): login flows, options, token store, session lifecycle
|
||||
- [reference/player.md](reference/player.md): profile, wallets, counters
|
||||
- [reference/player.md](reference/player.md): profile, balances, items
|
||||
- [reference/storage.md](reference/storage.md): player storage, limits
|
||||
- [reference/modules.md](reference/modules.md): generated clients, `modules.call`, idempotency, retries, errors
|
||||
|
||||
Reference in New Issue
Block a user