Skip to content

API overview

HyperToken exposes a CRDT-native core plus the Engine facade. The public package entrypoint is core/index.ts (published as dist/core/index.js).

The root export surface currently includes:

Token, Stack, Space, Source, Chronicle, ConsensusCore, Emitter, mulberry32, shuffleArray, parseTokenSetObject, loadTokenSetJSON, and Engine.

Storage adapters and network classes are not re-exported by core/index.ts; use their documented deep module paths.

The most common path is:

  1. Create a Chronicle.
  2. Attach Stack, Space, and/or Source facades to that same session.
  3. Construct an Engine with those components.
  4. Mutate through await engine.dispatch(type, payload).
  5. Observe state:changed on the Chronicle or state:updated on the Engine.

All containers are views over one Automerge document. Tokens are immutable values. Concurrent changes merge using Automerge CRDT semantics; this is not transactional last-command-wins gameplay.

See Engine API, Token API, and the storage and network pages for operational integrations.