NeoBean
Client request headers with createTRPCProxyClient
Simple proxy client, following the documentation
I'm using this helper inside my sveltekit load function, which runs server side.
I see no way of forwarding the headers which i get from browser.
2 replies
Pass headers when prefetching using helpers
I dont see a way to pass headers and cookies with either fetch/prefetch methods from the ssr helper.
They accept a context option but it is typed as a
Record<string..
, so i'm not sure what it does.
I'm following the external routers. https://trpc.io/docs/client/nextjs/server-side-helpers#2-external-router4 replies
Forward client headers with createTRPCProxyClient & Server-Side Helpers
With
createTRPCNext
i had the option to tap into the context.req
object nextjs passed in, but I cant achieve the same with createTRPCProxyClient
.
For example below code fails authentication, cause cookies arent forwarded.
8 replies