T
tRPC

Integrate third-party added endpoints into the router definition?

Integrate third-party added endpoints into the router definition?

Nninjago4/18/2023
Its would be cool but not too important, so I was wondering whether or not it would be possible to have dummy router configs without any actual routers. I am using SuperTokens for my Auth and it adds several endpoints to my server (/auth/signup, /auth/login and so on), and it would be cool to somehow add these into tRPC so that I could ditch custom fetch calls.
Nnlucas4/18/2023
You could use tRPC as a proxy to those endpoints, or you could use their SDK to integrate the functionality manually There’s no free lunch though, you’ll need to write something
Nninjago4/18/2023
Yeah, I was just wondering if there was some TS magic that could be done to get the types into the router and have the TRPC call the endpoints. I guess I'll leave that aside for now
Nnlucas4/18/2023
If you can get TS types either by codegen or from an SDK then tying those into tRPC should be a breeze. Outputs get inferred, inputs might be a bit more effort as you’d be best off writing some Zod types for them
Nninjago4/18/2023
@Nick Lucas I know the Types, they're rather simplistic. how could I integrate those into the router?
Nnlucas4/18/2023
Same way as writing any router/procedure really You're just writing a wrapper

Looking for more? Join the community!

T
tRPC

Integrate third-party added endpoints into the router definition?

Join Server
Recommended Posts
Why am I seeing 500 errors on responses to clients in production?I'm running my trpc server with NODE_ENV=production with the expressjs adapter, and I'm getting thistrpc auto refreshes page when I lose focusHi, i thought this was a development environment only configuration, but it does it even in productiIncorrect type errorsNo idea if this is a trpc issue, but i'm having a bit of a nightmare with type errors. Nothing is shtest post 2hello againquery debounceHey there ! I wonder if anyone could point me to a standard recipe to achieve query debouncing and Type of createServerSideHelpers?I'm currently trying to implement a helper for `getServerSideProps` to reduce duplication. It's stilhow to set request timeout in clientcreateProxyClient has no option about timeout like axios does. Just in one router request (query or trpc rate limitinghi I am currently having some problems with a race condition in my TRPC nextJS api. Essentially whtrpc pipe middlewareHey all. I'm currently trying to create a middle ware on endpoints using the new `pipe` API. This Has anyone ever used tRPC (with SSR) and i18n?No matter the lib (next-intl, next-i18n, next-translate), I simply stumble from one problem to anothNew to tRPC and Need Help with BasicsI made a new T3 app, but I don't quite understand how tRPC works, and I would love to get some help web socket keeps on disconnecting and connectingHi! Its my first time using web sockets. The first code snippet is my socket code. The second code sPagination QueryHi, I'm new for web dev and I'm moved to tRPC not so long I'm looking for example of pagination quEnrich the response object for TRPC endpointCurrently when I hit a trpc endpoint I get something like: ```typescript { result: { data:Can i fetch tRPC in different project@coco- : I Make a tRPC in my project. Can I use the enpoint api in different project ?Importing AppRouter types from an external repoI've got a production T3 app already in production. I've created a fresh expo app to start building TypeScript type for request object for route handlersSo far I've been writing my routes like: ```typescript export const router = t.router({ helloWorlTyped wrappers for proceduresI have a TRPC client with working queries and mutations. I wanted to create wrapper functions for al