trpc-panel icon indicating copy to clipboard operation
trpc-panel copied to clipboard

Define custom HTTP headers in code

Open mikemclin opened this issue 2 years ago • 3 comments
trafficstars

As a person viewing the tRPC Panel, I would like to be able to have custom tRPC HTTP headers added automatically instead of manually adding them via the tRPC Panel's UI, so I can save time from copying auth tokens from my app to the panel.

Would it be possible to add custom header values to the renderTrpcPanel function as an option? This way, the app that is rendering the panel can generate an Authorization header (or any other custom headers) when the panel is initiated.

mikemclin avatar Jan 04 '23 05:01 mikemclin

It's funny you mention this - this is actually something I started implementing but never fully finished out b/c I wasn't sure how much people wanted it.

yes - Definitely would be a great feature for this lib I think.

just the ability to pass any headers object to the renderTrpcPanel function? Will probably merge them with saved headers if they exist

iway1 avatar Jan 04 '23 13:01 iway1

This would be a great feature! Allows to make authentication automatic (:

BracketJohn avatar Feb 13 '23 09:02 BracketJohn

I second this 😅

lewxdev avatar Aug 12 '23 18:08 lewxdev