-
Is it possible to access the I'm looking for a way to integrate import * as trpc from '@trpc/server'
import * as trpcNext from '@trpc/server/adapters/next'
import { getAuth } from '@clerk/nextjs/server'
export const createContext = async (opts: trpcNext.CreateNextContextOptions) => {
return { auth: getAuth(opts.req) }
}
export type Context = trpc.inferAsyncReturnType<typeof createContext> How would I do this with |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, currently no way to do it, unfortunately. That's not a limitation of this library, it's a limitation of React Server Actions, they don't expose the underlying POST request, you can only access |
Beta Was this translation helpful? Give feedback.
Hi, currently no way to do it, unfortunately. That's not a limitation of this library, it's a limitation of React Server Actions, they don't expose the underlying POST request, you can only access
headers()
andcookies()
via Next.js exported functions. You'd have to use route handlers if you want to access the request object.