Can we use Nextjs trpc endpoint for other apps?

Like i have built t3 app. I need some of the end points in my next react app. Can i call it?.
7 Replies
Pod
Pod2y ago
Yes, tRPC endpoints are just normal REST urls. You can use the network tab to see it, or if you want it more friendly, look into something like trpc-openapi.
cje
cje2y ago
if you put the two apps in a monorepo together, you can also use trpc to make requests to one app from the other but yea other than that trpc-openapi is the best solution
dishant8314
dishant8314OP2y ago
thanks @cje @Pod Can i inetegreat trpc-open api in existing app. or i need to redevelop the app. basically trpc-openapi gives us a rest call right? this repo is for trpc open api ? -> https://github.com/jlalmes/trpc-openapi
GitHub
GitHub - jlalmes/trpc-openapi: OpenAPI support for tRPC 🧩
OpenAPI support for tRPC 🧩. Contribute to jlalmes/trpc-openapi development by creating an account on GitHub.
Pod
Pod2y ago
Nope you can use it in an existing one, and yes
basically trpc-openapi gives us a rest call right?
trpc is already REST calls, openapi just makes it more "standard" looking and provides documentation
dishant8314
dishant8314OP2y ago
ok thanks @Pod
Zan
Zan2y ago
trpc-openapi does make you add output validators though fwiw
dishant8314
dishant8314OP2y ago
Ok if we add open api then new types will generate in response? Or it remains the same.
Want results from more Discord servers?
Add your server