Company
Date Published
Author
Zack Proser
Word count
862
Language
English
Hacker News points
None

Summary

oRPC is an API toolkit that combines the familiarity of Remote Procedure Call (RPC) with the industry-standard OpenAPI spec, enabling type-safe APIs from client to server. It addresses common issues such as schema drift and integration bugs by collapsing definition, implementation, and documentation into a single, type-safe contract that travels unchanged throughout the system. This approach ensures end-to-end type-safety, contract-first design, and zero code-generation, making it suitable for micro-frontends, BFFs, edge-first workloads, and teams that care about OpenAPI. oRPC provides a flexible architecture for handling errors, including two approaches to error definitions using `.errors()` and fully typed error definitions using `ORPCError`. It also supports authentication and protected routes with the use of context objects and JWT parsing. By using oRPC, developers can write functions and get fully typed, OpenAPI-compliant endpoints without code-generation or drift, resulting in a single source of truth for their APIs.