Toapi
A fully-typed REST API toolkit for TypeScript. Define your API once on the server and get an end-to-end typed client — no code generation step.
The stack
Section titled “The stack”Toapi is a small family of composable packages. Start with @toapi/server to define your API, generate a typed client with @toapi/client, then add caching, routing, React bindings and a Vite plugin as you need them.
@toapi/serverDefine routes and handlers — the single source of truth for your API's types.
@toapi/clientAn end-to-end typed fetch client inferred from your server definition.
@toapi/workerA service worker runtime that caches and revalidates API responses offline.
@toapi/commonShared primitives: HttpError, TRequest/TResponse and the route type contract.
@toapi/cacheTag-based server cache with in-memory, filesystem, Redis and Postgres backends.
@toapi/routerA tiny, typed client-side router for React.
@toapi/reactReact bindings — the useQuery hook with Suspense and live revalidation.
@toapi/vite-pluginServe your API in dev and build a deployable server bundle with Vite.
Get started
Section titled “Get started”pnpm add @toapi/server @toapi/clientThen head to the server introduction to define your first API.