Skip to main content
Rapid provides a very easy to use hook in your frontend to consume the Rest API. We have created a hook called useRestClient that:
  1. Uses axios for request/response instead of fetch (This eliminates the weird error behaviour of fetch which make it not throw error in non-2xx responses).
  2. Attaches the auth JWT with every request.
Learn more about the TS-Rest React Query wrapper in the documentation.

Custom Client with Axios and JWT injection

React Query Super Contract Hook

This can be used like this: