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:
| Goal | Install |
|---|---|
| core authoring only | npm install -D @rexeus/typeweavernpm install @rexeus/typeweaver-core "zod@^4" |
| clients generation | core authoring + npm install -D @rexeus/typeweaver-clients |
| Hono integration | core authoring + npm install -D @rexeus/typeweaver-hononpm install hono |
| dependency-free server integration | core authoring + npm install -D @rexeus/typeweaver-server |
| AWS CDK routes | core 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.
Recommended reading path
For most readers, this is the shortest path through the docs:
- Quickstart — build one small spec and generate output
- First Operation — understand
defineOperation(...) - Generate and Run — choose plugins and generate consistently
- End-to-End Walkthrough — see the full loop from spec to client call
- 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.