Services & SDK
This section covers NetScript services and the typed SDK that calls them. You declare an API once as a versioned contract; the server handler, the typed client, the OpenAPI document and the query layer all derive from that one object. A service implements the contract and the SDK consumes it. Both import the same contract object, so a renamed field or a changed response shape is a compile error on both ends before it ships.
Guides
- Services & contracts: define a contract, implement it, and serve it
with
defineServiceor the fluent builder, including health, shutdown, TLS and service auth. - Typed SDK & client: call a service through a typed client, cache-first query factories and TanStack Query helpers.
- Transactional commands: commit mutations, replay receipts, audit and outbox intents together.
- Command outbox relay: publish committed intents with checked worker acceptance.
- Command operations, security and compatibility: reconcile failures and evolve durable records safely.
- Service layout: the folder vocabulary inside a service, when to split modules, and how to migrate an existing service.
- Recipes: add a service, discover services, expose OpenAPI and Scalar, call internal procedures, and protect anonymous routes.
The type-flow theory behind this section is in Contracts.