supastarter for Next.jsAPI
Use API in application
Learn how to fetch data from your API in your supastarter application.
To call your endpoints from the frontend, you can use Tanstack Query and the orpc
client, which will give you a type-safe way to call your endpoints.
Use API in a client component
If you have a mutation instead of a query, you can use useMutation
from Tanstack Query to call your endpoints.
Use API in a server component
To fetch data from the API in a server component, you can use the orpcClient
: