hono-rpc

Hono RPC - end-to-end type-safe API client generation with hc client and TypeScript inference

By bobmatnyc · 394 installs

npx skills add bobmatnyc/claude-mpm-skills --skill hono-rpc

Source repository · Upstream listing

Hono RPC Type Safe Client Overview Hono RPC enables sharing API specifications between server and client through TypeScript's type system. Export your server's type, and the client automatically knows all routes, request shapes, and response types no code generation required. Key Features : Zero codegen type safe client Automatic TypeScript inference Works with Zod validators Status code aware response types Supports path params, query, headers When to Use This Skill Use Hono RPC when: Building full stack TypeScript applications Need type safe API consumption without OpenAPI/codegen Want compile time validation of API calls Sharing types between client and server in monorepos Basic Setup Server Side Client Side Route Chaining for Type Export Important : Chain routes for proper type inference: Request Patterns Path Parameters Query Parameters JSON Body Form Data Headers Response Type Inference Status Code Aware Types Request Type Inference Multi File Route Organization Organize Routes Client Usage Error Handling Handle Fetch Errors Type Safe Error Responses Configuration Options Custom Fetch Default Headers Dynamic Headers Best Practices 1. Enable Strict Mode 2. Use Explicit Status Codes 3. Split Large Apps 4. Consistent Response Shapes Quick Reference Client Methods HTTP Method Client Method GET client.path.$get() POST client.path.$post() PUT client.path.$put() DELETE client.path.$delete() PATCH client.path.$patch() Request Options Type Utilities Related Skills hono core Framework fundamentals hono validation Request validation typescript core TypeScript patterns Version : Hono 4.x Last Updated : January 2025 License : MIT