Skip to content

tRPC v12 isn’t on npm yet. The @trpc12/* packages on this site can’t be installed until it’s released. Use v11 today

tRPC

Packages and stability

Every package and entry point, what each is for and where its docs are, and what experimental_ and @stability promise.

On this page

Everything server- and client-side is one package, @trpc12/trpc. The other packages fit it into a framework or a tool:

PackageFor
@trpc12/trpc (entry points)Routers, handlers, clients, links, middleware and adapters
@trpc12/tanstack-queryTanStack Query options, keys and filters, for any framework
@trpc12/tanstack-react-queryReact: context, useSubscription, and server components in /rsc
@trpc12/upgradeThe v11 to v12 codemod

The TanStack packages re-export @trpc12/tanstack-query, so an app installs one of them with TanStack's adapter for its framework.

effect is a peer dependency of @trpc12/trpc, so every install adds both, and the app's own Effect code shares the same copy. No schema library is a dependency: .input() takes zod, Valibot, ArkType or any other Standard Schema, or an Effect Schema (Input and output).

@trpc12/trpc entry points

EntryFor
@trpc12/trpc/serverinitTrpc, routers, handlers, callers (The server)
@trpc12/trpc/clientcreateTrpcClient, links, safe (The client, Links)
@trpc12/trpc/middlewareonStart, onSuccess, onError, onFinish (Built-in middleware)
@trpc12/trpc/effectcreateEffectClient (The Effect client)
@trpc12/trpc/serializerjsonSerializer, danSON, createSyncSerializer (Serializers)
@trpc12/trpc/httpserve, toHttpEffect on Effect's HttpServer (Adapters)
@trpc12/trpc/aws-lambdatoLambdaHandler for API Gateway, ALB and Lambda@Edge (AWS Lambda)
@trpc12/trpc/actionsexperimental_createAction, experimental_createCallable (Server Actions)
@trpc12/trpc/interopcreateV11Handler, fromV11Link for v11 code (Serving v11 clients)
@trpc12/trpc/extendbuilding blocks for integrations (Extensions)

Stability

An export whose name starts with experimental_ (such as experimental_createAction) may still change in a minor release, and so may every export of a package whose name starts with experimental-, whose exports have no prefix. When one becomes stable, it gets its name without the prefix, and the experimental_ name stays as a deprecated alias until the next major. npx @trpc12/upgrade rewrites those imports.

Every export's JSDoc carries @stability (stable or experimental) and @since. Until 12.0.0, prereleases promise nothing; @stability says how the export is planned to ship.

Versions

Each package has its own version. When a package releases, every package that depends on it releases too, built against the new version, so the newest version of each @trpc12/* package works with the newest of the others. Update them together.

Internal entry points

@trpc12/trpc/internal holds types that declaration emit refers to. Don't import it; it has no semver. @trpc12/trpc/internal/testing is a semi-public TestServer Effect layer for real-server tests (with @effect/vitest's it.layer); it has no compatibility promise either. Test in process with createRouterClient or localLink (Server-side calls).