Getting user IP in trpc without req object?
I used to get the users IP like so, just giving the package the req object:
With trpc, I don't have access to Next.JS's
req
object - how would I solve this now?3 Replies
You have access
On the createaContext function you have next request
thanks for the reply
I'm not sure how exactly I would add it though
Some help or a hint would help me out a lot!
My context.ts file looks like this:
On the createContext function
On the opts parameters you have both next request and response