chore: remove effects leftovers, dead SyncedState.set, add modules/resources skill refs

This commit is contained in:
edmand46
2026-09-17 14:15:37 +03:00
parent 4ab406c5cd
commit 34c53bbb68
14 changed files with 89 additions and 208 deletions
+9 -8
View File
@@ -38,7 +38,7 @@ const profile = client.player.data;
const gold = profile?.wallets?.find((w) => w.currency === 'gold')?.balance;
const items = await client.resources('items').list();
const result = await client.modules.call('quests', 'list');
const { result } = await client.modules.call('my_module', 'hello', { name: 'Bob' });
client.dispose();
```
@@ -47,7 +47,7 @@ client.dispose();
| Area | Access |
|---|---|
| Auth | `client.auth.loginWithDevice()`, `client.auth.loginWithCustom({ customData })`, `client.auth.logout()`, `client.auth.isAuthenticated`, `client.auth.onAuthStateChange(cb)` |
| Auth | `client.auth.loginWithDevice()`, `loginWithGoogle({ idToken })`, `loginWithApple({ idToken })`, `loginWithCustom({ customData })`, `linkWithGoogle(idToken)`, `linkWithApple(idToken)`, `linkWithCustom({ customData })`, `unlinkIdentity(provider)`, `logout()`, `isAuthenticated`, `onAuthStateChange(cb)` |
| Player / wallets | `client.player` (observable) |
| Catalog currencies | `client.catalog` (observable) |
| Storage | `client.storage` (observable) + `.save(items)` / `.delete(type)` |
@@ -55,9 +55,10 @@ client.dispose();
| Modules | `client.modules.call(module, fn, args?)` |
| Resources | `client.resources(slug)` → `list` / `get` / `create` / `update` / `delete` |
Game-design features (quests, stores, inventory, leaderboards, battle pass,
remote config) live in installed modules. Call them through
`client.modules.call` and read their rows through `client.resources(slug)`.
Game features are installed modules, not SDK services. The first-party
modules are items, inventory, reward, remote_config, leaderboards, quests,
store and battlepass. Call a module through `client.modules.call` and read its
rows through `client.resources(slug)`.
## Error handling
@@ -108,7 +109,7 @@ client.auth.onAuthStateChange((state) => {
Observable domains (`player`, `catalog`, `storage`, `projectStorage`) are
warmed at login (`player` and `catalog`) or on first use, then kept fresh by
a revision poll: the client asks the gateway for entity revisions every
a revision poll: the client asks the backend for entity revisions every
**30 s (±20% jitter)** and reloads only the entities whose revision grew.
Polling **pauses while the tab is hidden** and resumes on `visibilitychange`.
Storage writes invalidate the affected domain immediately. Expect data to be
@@ -142,8 +143,8 @@ function Wallet() {
npm run typecheck # tsc over src and tests
npm test # unit + local e2e (jsdom)
npm run build # tsup → dist (ESM + CJS + d.ts)
npm run test:e2e-prod # drives a seeded project on the live gateway
npm run test:e2e-prod # drives a seeded project on the live backend
```
Generated wire types (`src/generated`) come from the gateway's `apigen`; run
Generated wire types (`src/generated`) come from `liveops-backend/apigen`; run
`npm run generate` to refresh them. Do not edit them by hand.