skeld Get started
Browse documentation

skeld documentation

On this page

Build a service around one contract. Use it to validate incoming data, constrain outgoing data, and type the client that calls it.

sh
npm install @skeld/core
Install skeld

Start here

  1. 01Install skeldAdd the package to a new project, run one route, and call it through its contract.
  2. 02Your first requestRun the hello service and distinguish validation from application behavior.
  3. 03Design a contractChoose bounds, response fields, and explicit application outcomes.

Modules

The model

One contract, two sidesThe contract defines routes and schemas for both client and server. The client sends an HTTP request to the server, which validates input and serializes output. The server sends an HTTP response back to the client, which provides typed calls and validates replies. DefinesDefines ContractRoutes and schemasClientTyped callsValidate repliesServerValidate inputSerialize output HTTP requestHTTP response One contract, two sidesThe contract defines routes and schemas for both client and server. The client sends an HTTP request to the server, which validates input and serializes output. The server sends an HTTP response back to the client, which provides typed calls and validates replies. DefinesDefines ContractRoutes and schemasClientTyped callsValidate repliesServerValidate inputSerialize output HTTPrequestHTTPresponse
Mermaid equivalent
flowchart TD
    Contract["Contract<br/>Routes and schemas"] -->|Defines| Client["Client<br/>Typed calls<br/>Validate replies"]
    Contract -->|Defines| Server["Server<br/>Validate input<br/>Serialize output"]
    Client -->|HTTP<br/>request| Server
    Server -->|HTTP<br/>response| Client

The contract supplies both sides. HTTP still crosses a trust boundary: server validation protects the handler, and client validation checks responses for declared statuses. Sharing TypeScript types alone would establish neither property.

Guides

  • Clients and errorsNarrow responses by status and separate HTTP outcomes from failed calls.
  • Plugins and lifecycleGive a feature its own routes, hooks, state, and cleanup.
  • Classify dataKeep secret and personal values out of schema-aware logs and control response exposure.
  • Connect a browserConfigure CORS, cross-site checks, cookies, and redirects together.
  • Run a serviceSet the public origin, proxy trust, timeouts, logging, and shutdown behavior.
  • TroubleshootDiagnose startup failures, refused requests, missing logs, and invalid responses.

Look up a detail