From 9f8ceae0ef957ce1945f60c8a9e0e4fc2a15b2db Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 23 Oct 2026 02:47:01 +0000 Subject: [PATCH] docs: add an oRPC definition and quick example to READMEs The root README and the package READMEs shown on npm went straight from badges to the package table, so neither readers nor search engines and AI assistants got a plain statement of what oRPC is. Add a short definition and a minimal router/client example to every copy, and give the documentation link descriptive text instead of "here". Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01EHxSoP6NZjYvqLsw6itB38 --- README.md | 33 ++++++++++++++++++++++++++++++- packages/ai-sdk/README.md | 33 ++++++++++++++++++++++++++++++- packages/arktype/README.md | 33 ++++++++++++++++++++++++++++++- packages/bun/README.md | 33 ++++++++++++++++++++++++++++++- packages/client/README.md | 33 ++++++++++++++++++++++++++++++- packages/cloudflare/README.md | 33 ++++++++++++++++++++++++++++++- packages/contract/README.md | 33 ++++++++++++++++++++++++++++++- packages/effect/README.md | 33 ++++++++++++++++++++++++++++++- packages/evlog/README.md | 33 ++++++++++++++++++++++++++++++- packages/hibernation/README.md | 33 ++++++++++++++++++++++++++++++- packages/json-schema/README.md | 33 ++++++++++++++++++++++++++++++- packages/lock/README.md | 33 ++++++++++++++++++++++++++++++- packages/mcp/README.md | 33 ++++++++++++++++++++++++++++++- packages/msw/README.md | 33 ++++++++++++++++++++++++++++++- packages/nest/README.md | 33 ++++++++++++++++++++++++++++++- packages/next/README.md | 33 ++++++++++++++++++++++++++++++- packages/node/README.md | 33 ++++++++++++++++++++++++++++++- packages/openapi/README.md | 33 ++++++++++++++++++++++++++++++- packages/opentelemetry/README.md | 33 ++++++++++++++++++++++++++++++- packages/pinia-colada/README.md | 33 ++++++++++++++++++++++++++++++- packages/pino/README.md | 33 ++++++++++++++++++++++++++++++- packages/publisher/README.md | 33 ++++++++++++++++++++++++++++++- packages/ratelimit/README.md | 33 ++++++++++++++++++++++++++++++- packages/server/README.md | 33 ++++++++++++++++++++++++++++++- packages/shared/README.md | 33 ++++++++++++++++++++++++++++++- packages/swr/README.md | 33 ++++++++++++++++++++++++++++++- packages/tanstack-query/README.md | 33 ++++++++++++++++++++++++++++++- packages/trpc/README.md | 33 ++++++++++++++++++++++++++++++- packages/valibot/README.md | 33 ++++++++++++++++++++++++++++++- packages/zod/README.md | 33 ++++++++++++++++++++++++++++++- 30 files changed, 960 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 040ca6692..d5b7d8532 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/ai-sdk/README.md b/packages/ai-sdk/README.md index c422a37cb..d61c57bfd 100644 --- a/packages/ai-sdk/README.md +++ b/packages/ai-sdk/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/arktype/README.md b/packages/arktype/README.md index 0615759a0..d503f69bd 100644 --- a/packages/arktype/README.md +++ b/packages/arktype/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/bun/README.md b/packages/bun/README.md index 497739701..9458fbb66 100644 --- a/packages/bun/README.md +++ b/packages/bun/README.md @@ -18,9 +18,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/client/README.md b/packages/client/README.md index 040ca6692..d5b7d8532 100644 --- a/packages/client/README.md +++ b/packages/client/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/cloudflare/README.md b/packages/cloudflare/README.md index 3c46e8dd1..d6a9a3be8 100644 --- a/packages/cloudflare/README.md +++ b/packages/cloudflare/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/contract/README.md b/packages/contract/README.md index 4b6a7336b..8786991f8 100644 --- a/packages/contract/README.md +++ b/packages/contract/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/effect/README.md b/packages/effect/README.md index edaf5da1d..7571384f1 100644 --- a/packages/effect/README.md +++ b/packages/effect/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/evlog/README.md b/packages/evlog/README.md index 78e659bdb..5dc7dbcf8 100644 --- a/packages/evlog/README.md +++ b/packages/evlog/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/hibernation/README.md b/packages/hibernation/README.md index 7424b8b03..526f7413a 100644 --- a/packages/hibernation/README.md +++ b/packages/hibernation/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/json-schema/README.md b/packages/json-schema/README.md index 949636ed8..6949d4554 100644 --- a/packages/json-schema/README.md +++ b/packages/json-schema/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/lock/README.md b/packages/lock/README.md index 4f26b82ce..908e7509e 100644 --- a/packages/lock/README.md +++ b/packages/lock/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/mcp/README.md b/packages/mcp/README.md index 513788f0b..1862a1fc2 100644 --- a/packages/mcp/README.md +++ b/packages/mcp/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/msw/README.md b/packages/msw/README.md index e119f8d1d..f51409072 100644 --- a/packages/msw/README.md +++ b/packages/msw/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/nest/README.md b/packages/nest/README.md index 95ca7b669..aa02c421f 100644 --- a/packages/nest/README.md +++ b/packages/nest/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/next/README.md b/packages/next/README.md index d406d330d..bb505b906 100644 --- a/packages/next/README.md +++ b/packages/next/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/node/README.md b/packages/node/README.md index 3d26c0280..39acc7871 100644 --- a/packages/node/README.md +++ b/packages/node/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/openapi/README.md b/packages/openapi/README.md index 86f14b3fb..b79ebb29e 100644 --- a/packages/openapi/README.md +++ b/packages/openapi/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/opentelemetry/README.md b/packages/opentelemetry/README.md index cec1e3a77..b6ea8e897 100644 --- a/packages/opentelemetry/README.md +++ b/packages/opentelemetry/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/pinia-colada/README.md b/packages/pinia-colada/README.md index b6d698e89..7d3c5bf87 100644 --- a/packages/pinia-colada/README.md +++ b/packages/pinia-colada/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/pino/README.md b/packages/pino/README.md index baca3bcf9..6a0acd616 100644 --- a/packages/pino/README.md +++ b/packages/pino/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/publisher/README.md b/packages/publisher/README.md index e1c2bd9b9..cc8bd2f95 100644 --- a/packages/publisher/README.md +++ b/packages/publisher/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/ratelimit/README.md b/packages/ratelimit/README.md index b3b331a9c..2c6f4ad64 100644 --- a/packages/ratelimit/README.md +++ b/packages/ratelimit/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/server/README.md b/packages/server/README.md index a83e6562a..0ff31b44f 100644 --- a/packages/server/README.md +++ b/packages/server/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/shared/README.md b/packages/shared/README.md index 903d7d23f..923d07355 100644 --- a/packages/shared/README.md +++ b/packages/shared/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/swr/README.md b/packages/swr/README.md index a1265b978..55c997a65 100644 --- a/packages/swr/README.md +++ b/packages/swr/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/tanstack-query/README.md b/packages/tanstack-query/README.md index 3158b951d..c6dd96aa5 100644 --- a/packages/tanstack-query/README.md +++ b/packages/tanstack-query/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/trpc/README.md b/packages/trpc/README.md index e8c3badff..3df249d5d 100644 --- a/packages/trpc/README.md +++ b/packages/trpc/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/valibot/README.md b/packages/valibot/README.md index b33903d84..1a930d57c 100644 --- a/packages/valibot/README.md +++ b/packages/valibot/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages diff --git a/packages/zod/README.md b/packages/zod/README.md index 98183c67e..241a31053 100644 --- a/packages/zod/README.md +++ b/packages/zod/README.md @@ -21,9 +21,40 @@ +**oRPC** is a TypeScript framework for building end-to-end typesafe APIs. Write your API once as plain TypeScript functions, and oRPC gives you a fully typed client, a REST API with an OpenAPI document, and MCP tools for AI agents, with no code generation. It runs on Node.js, Bun, Deno, Cloudflare Workers, and more. + +Define procedures on the server and serve them with an [RPC handler](https://orpc.dev/docs/rpc/handler): + +```ts +import { os } from '@orpc/server' +import * as z from 'zod' + +export const router = { + planet: { + find: os + .input(z.object({ id: z.number() })) + .handler(({ input }) => ({ id: input.id, name: 'Earth' })), + }, +} +``` + +Then call them from a client that knows every input and output, without generating anything: + +```ts +import type { RouterClient } from '@orpc/server' +import type { router } from './router' +import { createORPCClient } from '@orpc/client' +import { RPCLink } from '@orpc/client/fetch' + +const link = new RPCLink({ origin: 'http://localhost:3000', url: '/rpc' }) +const client: RouterClient = createORPCClient(link) + +const planet = await client.planet.find({ id: 1 }) // { id: number, name: string } +``` + ## Documentation -You can read the documentation [here](https://orpc.dev). +Read the full documentation at [orpc.dev](https://orpc.dev), starting with the [Getting Started guide](https://orpc.dev/docs/getting-started). ## Packages