# Packages and stability

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

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

| Package                                                                        | For                                                                    |
| ------------------------------------------------------------------------------ | ---------------------------------------------------------------------- |
| `@trpc12/trpc` ([entry points](#trpc12trpc-entry-points))                      | Routers, handlers, clients, links, middleware, adapters and OpenAPI    |
| [`@trpc12/tanstack-query`](https://v12.trpc.io/docs/integrations/tanstack-query.md)                   | TanStack Query options, keys and filters, for any framework            |
| [`@trpc12/tanstack-react-query`](https://v12.trpc.io/docs/integrations/tanstack-query/react.md)       | React: context, `useSubscription`, and server components in `/rsc`     |
| [`@trpc12/tanstack-preact-query`](https://v12.trpc.io/docs/integrations/tanstack-query/preact.md)     | Preact: context and `useSubscription`                                  |
| [`@trpc12/tanstack-vue-query`](https://v12.trpc.io/docs/integrations/tanstack-query/vue.md)           | Vue: an app plugin and `useSubscription`                               |
| [`@trpc12/tanstack-solid-query`](https://v12.trpc.io/docs/integrations/tanstack-query/solid.md)       | Solid: context and `useSubscription`                                   |
| [`@trpc12/tanstack-svelte-query`](https://v12.trpc.io/docs/integrations/tanstack-query/svelte.md)     | Svelte: context and `createSubscription`                               |
| [`@trpc12/tanstack-angular-query`](https://v12.trpc.io/docs/integrations/tanstack-query/angular.md)   | Angular: providers, injectors and `injectSubscription`                 |
| [`@trpc12/tanstack-lit-query`](https://v12.trpc.io/docs/integrations/tanstack-query/lit.md)           | Lit: a provider element and `createSubscriptionController`             |
| [`@trpc12/experimental-react`](https://v12.trpc.io/docs/integrations/experimental-react.md)           | React with `use()` and Suspense, without TanStack Query (experimental) |
| [`@trpc12/experimental-react-atom`](https://v12.trpc.io/docs/integrations/experimental-react-atom.md) | Queries, mutations and subscriptions as Effect atoms (experimental)    |
| [`@trpc12/nest`](https://v12.trpc.io/docs/integrations/nestjs.md)                                     | A contract served from NestJS controllers                              |
| [`@trpc12/upgrade`](https://v12.trpc.io/docs/migrations/from-v11/codemod.md)                          | The 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.

## `@trpc12/trpc` entry points

| Entry                             | For                                                                                                                                                       |
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `@trpc12/trpc/server`             | `initTrpc`, routers, handlers, callers, `Publisher` ([The server](https://v12.trpc.io/docs/server/overview.md))                                                                  |
| `@trpc12/trpc/client`             | `createTrpcClient`, links, `safe` ([The client](https://v12.trpc.io/docs/client/overview.md), [Links](https://v12.trpc.io/docs/client/links.md))                                                        |
| `@trpc12/trpc/middleware`         | `onStart`, `onSuccess`, `onError`, `onFinish`, `rateLimit`, `experimental_lock`, `experimental_durable` ([Built-in middleware](https://v12.trpc.io/docs/middleware/overview.md)) |
| `@trpc12/trpc/effect`             | `createEffectClient` ([The Effect client](https://v12.trpc.io/docs/client/effect.md))                                                                                            |
| `@trpc12/trpc/contract`           | contract-first routers, `toContract` ([Contract-first](https://v12.trpc.io/docs/server/contract-first.md))                                                                       |
| `@trpc12/trpc/serializer`         | `jsonSerializer`, danSON, `createSyncSerializer` ([Serializers](https://v12.trpc.io/docs/server/serializers.md))                                                                 |
| `@trpc12/trpc/http`               | `serve`, `toHttpEffect` on Effect's `HttpServer` ([Adapters](https://v12.trpc.io/docs/adapters/overview.md))                                                                     |
| `@trpc12/trpc/cloudflare`         | hibernating WebSockets, publisher and locks on Durable Objects; Workers Traces ([Durable Objects](https://v12.trpc.io/docs/adapters/durable-objects.md))                         |
| `@trpc12/trpc/aws-lambda`         | `toLambdaHandler` for API Gateway, ALB and Lambda@Edge ([AWS Lambda](https://v12.trpc.io/docs/adapters/aws-lambda.md))                                                           |
| `@trpc12/trpc/socket`             | `serveSocket` on Effect's `SocketServer` (TCP, TLS) ([Raw sockets](https://v12.trpc.io/docs/adapters/sockets.md))                                                                |
| `@trpc12/trpc/openapi`            | `createOpenApiHandler`, `generateOpenApi`, `openApiLink` ([OpenAPI](https://v12.trpc.io/docs/openapi/overview.md))                                                               |
| `@trpc12/trpc/openapi/typescript` | `experimental_generateOpenApiFromTypes`, a document from the router's types ([The document](https://v12.trpc.io/docs/openapi/document.md))                                       |
| `@trpc12/trpc/actions`            | `experimental_createAction`, `experimental_createCallable` ([Server Actions](https://v12.trpc.io/docs/integrations/server-actions.md))                                           |
| `@trpc12/trpc/interop`            | `createV11Handler`, `fromV11Link` for v11 code ([Serving v11 clients](https://v12.trpc.io/docs/migrations/from-v11/serve-v11-clients.md))                                        |
| `@trpc12/trpc/extend`             | building blocks for integrations ([Extensions](https://v12.trpc.io/docs/server/extensions.md#building-integrations))                                                             |

## Stability

An export whose name starts with `experimental_` (such as `experimental_durableLink`) may still change in a minor release, and so may every export of a package whose name starts with `experimental-` (such as `@trpc12/experimental-react`), 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.

## 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](https://v12.trpc.io/docs/server/server-side-calls.md)).
