@state-server/sdk is the canonical JavaScript / TypeScript client for the Avvyland state-server. It wraps the REST API and WebSocket Protocol v2.0 into a single StateServerSDK object with seven high-level service modules.
Source of truth. This wiki mirrors state-server/docs/JS/*.md from gitlab.avvyland.com/avvy/state-server. The repo is canonical — update there first, then resync here.
StateServerSDK (extends EventEmitter)
├── api → ApiClient (HTTP/CBOR, retries, idempotency)
├── ws → WebSocketClient (Protocol v2.0, CBOR streaming)
├── auth → AuthService (registration, login, OAuth, sessions)
├── entities → EntityService (objects, prototypes, users, companies)
├── userState → UserStateService (user state management)
├── health → HealthService (server health probes)
├── braneDiscovery → BraneDiscoveryService (visits, analytics, GDPR)
├── walkthrough → WalkthroughService (brane walkthroughs)
└── modelPreview → ModelPreviewService (async model processing)
Getting Started — installation, import patterns, quick start, runtime requirements.
Authentication — register / login / OAuth / sessions / tokens.
Objects — blocks, groups, branes: CRUD, hierarchy, visibility, inventory.
Real-Time WebSocket — brane streaming, subscriptions, mutations, undo/redo.
Model Processing — preview, object pipeline, projection workflow, projection-derived 3D model.
These exist in state-server/docs/JS/ and are pending mirror in a follow-up round. Read in-repo until they land here:
configuration.md — every option on StateServerSDK.core-concepts.md — data model, CBOR, IDs, timestamps.prototypes.md — template CRUD, versioning, instantiation, gallery.users.md — profiles, settings, inventory, ID listings.company-accounts.md — shared company profiles + membership.brane-discovery.md — visit tracking, popular branes, GDPR.walkthroughs.md — brane waypoint paths with previews.health-monitoring.md — server health probes.error-handling.md — error classes, status codes, retries.api-client.md — low-level HTTP client, interceptors, CBOR.events-reference.md — full SDK event listing.types-reference.md — type definitions with field detail.advanced-topics.md — batch operations, Node vs browser, TLS, replay checkpoints.examples-recipes.md — copy-paste patterns.fetch, modern crypto.| Format | File | Description |
|---|---|---|
| ESM | dist/state-server-sdk.esm.js |
For bundlers and modern runtimes. |
| CJS | dist/state-server-sdk.js |
CommonJS for Node require(). |
| UMD | dist/state-server-sdk.umd.js |
Universal module for <script> tags. |
| UMD min | dist/state-server-sdk.min.js |
Minified UMD for production browsers. |
cbor-x — CBOR encoder/decoder.eventemitter3 — cross-platform event emitter.gitlab.avvyland.com/avvy/state-server — docs/JS_SDK.md, docs/JS/*.md.