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
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.
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
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.
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
ok thanks @Pod
trpc-openapi does make you add output validators though fwiw
Ok if we add open api then new types will generate in response? Or it remains the same.