type: decision
status: active
timestamp: 2026-06-20
tags: [api, hono, types, typescript, rpc]

Hono RPC for type-safe API client

Type-safe site to API client via Hono. No codegen \ no schema files \u2014 backend types flow to N frontends through a workspace package."

Hono RPC for type-safe API client

Decision

Sites and extensions call the umbrella Hono Worker via Hono’s RPC client hc<AppType>. The Worker exports type AppType = typeof app, which flows to every consumer through the workspace package @chirag127/api-client. No codegen step, no separate schema file, no OpenAPI emit.

Why

Hono’s hc gives end-to-end type-safety for free as long as the backend and frontend are in the same TypeScript project. Treating the master oriz repo as a workspace + publishing @chirag127/api-client as a thin re-export of the Worker’s AppType lets every site and extension import a fully-typed client without an intermediate spec file. Eliminates the codegen drift problem entirely.

Implications

Cross-refs


Edit on GitHub · Back to index