T
Join ServertRPC
❓-help
Request context from getServerSideProps
The docs of tRPC context https://trpc.io/docs/v10/context
But how to use this function from
export async function createContext(opts: trpcNext.CreateNextContextOptions) {
But how to use this function from
getServerSideProps
(in order to use SSG helpers)?Use the
https://github.com/trpc/trpc/blob/next/examples/next-prisma-starter/src/server/context.ts
createContextInner
patternhttps://github.com/trpc/trpc/blob/next/examples/next-prisma-starter/src/server/context.ts