Skip to content
tRPC

Partners

Interface: FastifyTRPCPluginOptions<TRouter>

On this page

Defined in: packages/server/src/adapters/fastify/fastifyTRPCPlugin.ts:25

The options of fastifyTRPCPlugin.

See

https://trpc.io/docs/server/adapters/fastify#fastify-plugin-options

Type Parameters

Type Parameter
TRouter extends AnyTRPCRouter

Properties

prefix?

optional prefix: string

Defined in: packages/server/src/adapters/fastify/fastifyTRPCPlugin.ts:27

The path the router is served at, such as /trpc.


trpcOptions

trpcOptions: HTTPBaseHandlerOptions<TRouter, FastifyRequest<RouteGenericInterface, RawServerDefault, IncomingMessage, FastifySchema, FastifyTypeProviderDefault, unknown, FastifyBaseLogger, ResolveFastifyRequestType<FastifyTypeProviderDefault, FastifySchema, RouteGenericInterface>>> & object & PartialIf<object extends inferRouterContext<TRouter> ? true : false, { createContext: NodeHTTPCreateContextFn; }> & Pick<WSSHandlerOptions<TRouter>, "keepAlive" | "dangerouslyDisablePong" | "experimental_encoder">

Defined in: packages/server/src/adapters/fastify/fastifyTRPCPlugin.ts:38

The router and handler options. keepAlive, dangerouslyDisablePong and experimental_encoder only apply with useWSS.

Type declaration

maxBodySize?

optional maxBodySize: number

The largest request body, in bytes. A larger one gets a PAYLOAD_TOO_LARGE error. It applies to bodies tRPC streams, such as multipart/form-data; JSON bodies are read by Fastify, so limit them with Fastify's bodyLimit.


useWSS?

optional useWSS: boolean

Defined in: packages/server/src/adapters/fastify/fastifyTRPCPlugin.ts:33

Whether to serve WebSockets too. Needs @fastify/websocket to be registered first.

See

https://trpc.io/docs/server/adapters/fastify#enable-websockets