tRPCttRPC
Powered by
nehalistN
tRPC•4y ago•
1 reply
nehalist

Request context from getServerSideProps

The docs of tRPC context https://trpc.io/docs/v10/context

export async function createContext(opts: trpcNext.CreateNextContextOptions) {
export async function createContext(opts: trpcNext.CreateNextContextOptions) {


But how to use this function from
getServerSideProps
getServerSideProps
(in order to use SSG helpers)?
Request Context | tRPC
The createContext() function is called for each request and the result is propagated to all resolvers. You can use this to pass contextual data down to the resolvers.
Request Context | tRPC
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Request context inside middleware?
HuzefHHuzef / ❓-help
4y ago
proxyClient not sending cookies from getServerSideProps
Answer OverflowAAnswer Overflow / ❓-help
10mo ago
tRPC + getServerSideProps
Ahmed ElsakaanAAhmed Elsakaan / ❓-help
4y ago