API Reference
Use this page for the main public API. The generated API pages are still available when exact signatures matter.
Main entry points
| Export | Purpose |
|---|---|
createSimulatorClient | Canonical factory for the namespaced SDK client. |
SimulatorClient | Public client type with system, cards, matches, session, and limitedEvents. |
MatchSession | Stateful helper for one seat WebSocket session. |
parseSchema | Runtime validator for generated wire schemas. |
EngineHttpError | Non-2xx HTTP error with request and body context. |
SdkValidationError | Schema validation failure for requests, responses, or socket frames. |
Resource types
| Resource | Methods |
|---|---|
SystemResource | health(), stats() |
CardsResource | get(ids), covered() |
MatchesResource | create(), join(), get(), applyFormatEvent() |
SessionResource | create() |
LimitedEventsResource | create(), join(), get(), applyCommand() |
Generated protocol types
Protocol types are exported from the package root and from the generated subpath:
ts
import type { GameCommand, GameEvent, GameState } from '@my-swu/simulator-client/generated'JSON schema files are available as package assets:
ts
import clientMessageSchema from '@my-swu/simulator-client/schema/client-message.schema.json'Regenerating reference docs
bash
pnpm docs:apiThe root docs:build script runs this before VitePress builds the site.
