Is there RESTful API available for auth features of Supabase

We are trying out Supabase and found it awesome, especially about how easy it is to implement user authentication. So far we have been using the official JavaScript client library and everything we tried works (thumbs up to the devs!).

Yet for some of our projects, we are using OCaml as the backend, which is not based on a JavaScript runtime. It seems that there exists client libraries for other native languages such as Go and Rust, and the official website documents RESTful API to access the database.

I'd like to know if it is possible to integrate with the auth features provided by Supabase via RESTful API, i.e., without using the official JavaScript client. I tried but I was not able to find documentation around this.


Solution 1:

Yes, there is a RESTful API.

Supabase uses a modified version of Netlify's GoTrue server and you can communicate directly with it. The main page of the GitHub repo also includes docs for the endpoints.

There is a reference page about the APIs, however, it seems that it is out of date and might NOT be maintained anymore (e.g. it is missing the generate_link API: https://github.com/supabase/gotrue/pull/133).

NOTE, that the Supabase.js auth methods are just wrappers around these APIs so you can also inspect the network calls each of these methods makes to get more practical information about the available APIs.

Finally, NOTE that some of these RESTful APIs are available ONLY with the service_role API key (i.e. they can be safely called ONLY from a server environment).