ScriptsSep 11, 2026·2 min read

oRPC — Typesafe RPC Framework for TypeScript

Build end-to-end typesafe APIs with a lightweight RPC framework that works across React, Vue, Svelte, and server runtimes.

Agent ready

Ready-to-run agent install

This asset can be installed after the agent chooses its runtime, checks the plan, and runs the matching command.

Native · 98/100Policy: allow
Agent surface
Any MCP/CLI agent
Kind
Skill
Install
Single
Trust
Trust: Established
Entrypoint
oRPC Overview
Direct install command
npx -y tokrepo@latest install 78c8b4c7-ada5-11f1-9bc6-00163e2b0d79 --target codex

Run after dry-run confirms the install plan.

Introduction

oRPC is a lightweight TypeScript RPC framework that gives you end-to-end type safety between server and client. It generates no code and requires no build step—types flow directly from your procedure definitions to your client calls.

What oRPC Does

  • Provides end-to-end type inference from server procedures to client calls
  • Supports input and output validation with Zod, Valibot, or any schema library
  • Works with React, Vue, Svelte, SolidJS, and TanStack Query integrations
  • Generates OpenAPI documentation from procedure definitions automatically
  • Runs on any runtime: Node.js, Bun, Deno, Cloudflare Workers, and edge functions

Architecture Overview

oRPC defines procedures on the server with input/output schemas. The client imports the router type and uses a proxy-based client that maps function calls to HTTP requests. Type inference travels through the router type without code generation, giving autocompletion and error checking at compile time.

Self-Hosting & Configuration

  • Install @orpc/server for the backend and @orpc/client for the frontend
  • Define procedures with input/output schemas using Zod or Valibot
  • Mount the router as an HTTP handler in Express, Hono, Next.js, or any framework
  • Use the TanStack Query integration for React/Vue data fetching
  • Enable OpenAPI generation with the @orpc/openapi plugin

Key Features

  • Zero code generation—types flow via TypeScript inference
  • Contract-first API design with optional OpenAPI spec output
  • Framework-agnostic client with adapters for TanStack Query and SWR
  • Middleware support for authentication, logging, and error handling
  • Streaming responses and server-sent events support

Comparison with Similar Tools

  • tRPC — pioneered TypeScript RPC; oRPC offers a simpler API with broader framework support
  • Hono RPC — Hono-specific RPC layer; oRPC is runtime-agnostic and works with any HTTP framework
  • ts-rest — contract-first REST API builder; oRPC uses RPC semantics with automatic OpenAPI output
  • GraphQL — schema-based query language; oRPC provides simpler procedure calls with full type safety

FAQ

Q: How is oRPC different from tRPC? A: oRPC has a simpler API surface, supports more schema libraries, and works with more frontend frameworks out of the box.

Q: Does oRPC require code generation? A: No. Types flow via TypeScript inference—no build step or generation needed.

Q: Can I generate OpenAPI docs? A: Yes. The @orpc/openapi plugin produces OpenAPI 3.1 specs from your router definition.

Q: What runtimes does oRPC support? A: Node.js, Bun, Deno, Cloudflare Workers, and any platform with a standard Request/Response API.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets