课程: Supabase Essential Training

The Supabase REST API

- [Instructor] Every modern cloud platform offers REST API and client libraries. Supabase is no exception, but what if Supabase went even further, Allowing custom defined REST endpoints? First I'm going to go to the API Docs section of my Supabase dashboard, and there is a section here on the left called TABLES AND VIEWS. I'm going to click on the table named customers. This is an API for the customers table in this Supabase instance. It was automatically generated once the table was created. By default, Supabase is going to show the JavaScript API for the table, but this is actually using REST underneath. I'm going to click Bash up here and everything switches to using curl on the command line. Let's run this now. I've already added a terminal environment variable for Supabase key, so I can copy this in and add some dollar signs and then just run this. So I'm going to add these two dollar signs, and then when I hit return, this is going to call the REST API. And there we go. We've called the REST API. I'm going to go back to the dashboard. Beyond JavaScript and Bash, Supabase has client libraries for Flutter, Python, C#, Swift, and Kotlin. The JavaScript client also has advanced support for TypeScript, which we will explore in-depth later. Some of the client libraries are community-supported, and if you can't find a library for your language, remember that you can make REST calls as well.

内容