Getting Started

Typeweaver is a contract-first tool for HTTP APIs. You describe requests and responses once, then generate types, validators, clients, and server helpers from that same spec.

This page helps you choose the right packages, understand the docs map, and find the fastest path from first spec to generated runtime code.

These docs reflect the current 0.10.x line. If you are upgrading from an earlier version, see the Migration Guides.

It is a good fit when you want:

  • one source of truth for client and server code
  • Zod-based request and response schemas
  • generated artifacts instead of hand-written API glue

It is especially useful when you want one clear map from spec authoring to generated runtime code.

Install the packages you need

Start with the core authoring set, then add plugin packages for the generated runtime you want:

GoalInstall
core authoring onlynpm install -D @rexeus/typeweaver
npm install @rexeus/typeweaver-core "zod@^4"
clients generationcore authoring + npm install -D @rexeus/typeweaver-clients
Hono integrationcore authoring + npm install -D @rexeus/typeweaver-hono
npm install hono
dependency-free server integrationcore authoring + npm install -D @rexeus/typeweaver-server
AWS CDK routescore authoring + npm install -D @rexeus/typeweaver-aws-cdk

If you want one short walkthrough before choosing a plugin, read End-to-End Walkthrough.

Where to begin

If you are brand new to Typeweaver, start with Quickstart.

If you already know the basic shape of the workflow and want the map for the rest of the docs, continue with the reading path below.

For most readers, this is the shortest path through the docs:

  1. Quickstart — build one small spec and generate output
  2. First Operation — understand defineOperation(...)
  3. Generate and Run — choose plugins and generate consistently
  4. End-to-End Walkthrough — see the full loop from spec to client call
  5. Output Structure — learn where the generated pieces live

After that, choose the branch that matches what you need next.

If you want to understand the client side

Read these next:

This path is for calling operations with generated commands and handling typed responses.

If you want to understand the server side

Read these next:

This path is for implementing handlers, validating requests and responses, and adding middleware around your routes.

Was this page helpful?