21Vic
In a monorepo can I have 2 packages each one with different trpc server, and use both in 1 app?
Hey @I am a Dev I personally haven't tried this but it seems to me this is perfectly fine! You'd want to do this, https://trpc.io/docs/client/vanilla/setup
for each API you want to use. Let's say you have API #1, and API #2. Then in App #1 you want to use both, you'd import the AppRouter type from both API#1 and API#2 and run the corresponding setup for each. Then say in App#2 you only want to use API#2, you'd only do it for that one.
I'd also imagine you can get rid of some of the client setup redundancies across apps if you setup a shared package that sets up a client for each API and then the clients can be shared amongst your other apps and used as needed!
5 replies