Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsSep 11, 2026·2 min de lecture

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.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
oRPC Overview
Commande d'installation directe
npx -y tokrepo@latest install 78c8b4c7-ada5-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en dry-run.

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

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires