tRPCttRPC
Powered by
ianI
tRPC•3y ago•
8 replies
ian

How to pass through authentication header when using createTRPCProxyClient and RSC?

Hi - we are having a great time with tRPC, and have it working well in a Next14 + React Server Components environment.

However, we're seeing that the headers aren't being passed through when a trpc query call is made from within a RSC component via await trcp.profile.me.query()

I looked into trying to pass through the headers and there's no way to access the actual headers from the current request, only to add new ones via headers() function.

What is the preferred way to pass through auth headers in a client => RSC => trpc.query => server environment?
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

Trying to lazy init "createTRPCProxyClient"
peterpPpeterp / ❓-help
3y ago
Difference between createTRPCNextAppDirServer, createTRPCNext and createTRPCProxyClient?
MaksMMaks / ❓-help
3y ago
onSuccess with createTRPCProxyClient
BillyBobBBillyBob / ❓-help
2y ago
Pass headers when prefetching using helpers
NeoBeanNNeoBean / ❓-help
3y ago