Skip to content
tRPC

Partners

Type Alias: ~~WithTRPCSSROptions<TRouter>~~

On this page

WithTRPCSSROptions<TRouter>: WithTRPCOptions<TRouter> & object

Defined in: withTRPC.tsx:81

Options for createTRPCNext and withTRPC with SSR on.

Type declaration

responseMeta()?

optional responseMeta: (opts) => ResponseMeta

Sets the status code and headers of the SSR response.

Parameters

ParameterType
opts{ clientErrors: TRPCClientError<TRouter>[]; ctx: NextPageContext; }
opts.clientErrorsTRPCClientError<TRouter>[]
opts.ctxNextPageContext

Returns

ResponseMeta

Deprecated

part of ssr: true. Set the status and headers in getServerSideProps instead.

See

https://trpc.io/docs/client/nextjs/pages-router/ssr#set-the-status-and-cache-headers

ssr

ssr: true | (opts) => boolean | Promise<boolean>

If you enable this, you also need to add a ssrPrepass-prop

Deprecated

built on @trpc/react-query. Prefetch each page's queries in getServerSideProps with @trpc/tanstack-react-query instead.

See

https://trpc.io/docs/client/nextjs/pages-router/ssr

ssrPrepass

ssrPrepass: TRPCPrepassHelper

use import { ssrPrepass } from '@trpc/next/ssrPrepass'

Deprecated

part of ssr: true, which is built on @trpc/react-query.

See

https://trpc.io/docs/client/nextjs/pages-router/ssr

Type Parameters

Type Parameter
TRouter extends AnyRouter

Deprecated

part of createTRPCNext, which is built on @trpc/react-query.

See

https://trpc.io/docs/client/nextjs/pages-router/setup#moving-from-createtrpcnext