Skip to content

API Reference

Use this page for the main public API. The generated API pages are still available when exact signatures matter.

Main entry points

ExportPurpose
createSimulatorClientCanonical factory for the namespaced SDK client.
SimulatorClientPublic client type with system, cards, matches, session, and limitedEvents.
MatchSessionStateful helper for one seat WebSocket session.
parseSchemaRuntime validator for generated wire schemas.
EngineHttpErrorNon-2xx HTTP error with request and body context.
SdkValidationErrorSchema validation failure for requests, responses, or socket frames.

Resource types

ResourceMethods
SystemResourcehealth(), stats()
CardsResourceget(ids), covered()
MatchesResourcecreate(), join(), get(), applyFormatEvent()
SessionResourcecreate()
LimitedEventsResourcecreate(), 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:api

The root docs:build script runs this before VitePress builds the site.

Released under the MIT License.