Connect to Supabase
Learn how to connect Supabase to Retool.
You can connect to a Supabase Serverless API using Retool's REST API integration and make it available as a resource. Once complete, you can write queries to interact with a Supabase Serverless API.
If you want to connect to a Supabase database, see the Connect to PostgreSQL guide.
Requirements
All users for Retool organizations on Free or Team plans have global Edit permissions and can add, edit, and remove resources. If your organization manages user permissions for resources, you must be a member of a group with Edit all permissions.
To create your Supabase resource, you need:
- REST API connection details.
- A valid ANON key.
Supabase uses Bearer (token) authentication. You must provide an API key or access token for Retool to authorize requests. Refer to the Supabase documentation on authenticating requests to learn how to obtain an API key or access token.
If Supabase is behind a firewall, you must also allow access from Retool's IP addresses. Add these IP addresses to your firewall's allowlist before you create the resource.
1. Create a new resource
Sign in to your Retool organization and navigate to the Resources tab. Click Create new, then select Resource.
Retool can connect to almost any API or database, and has built-in integrations for popular data sources. Select the REST API integration.
2. Configure the resource
Provide the necessary details to configure the resource so Retool can connect to Supabase. Not all settings are required but refer to the Supabase documentation to learn what is needed.
General
These settings configure the name and location of the resource within Retool.
Name
The name to use for the resource (e.g., Supabase).
Folder
The folder in which to save the resource.
Description
A brief description of the resource (e.g., Supabase data).
Credentials
These settings configure how Retool connects to Supabase.
Base URL
The base URL for the Supabase API. This must be an absolute URL, for example https://<PROJECT_REF>.supabase.co/rest/v1/
.
URL parameters
Key-value pairs to include as URL parameters with Supabase API requests. No additional URL parameters are required.
Headers
Key-value pairs to include as headers with Supabase API requests. Supabase uses Bearer (token) authentication, which includes your API key as a header value. Supabase also requires an apikey
header. Include the following key-value pairs:
Key | Value |
---|---|
Authorization | Bearer ANON_KEY |
apikey | ANON_KEY |
Body
Key-value pairs to include in the body of Supabase API requests. No additional body values are required.
Cookies
Cookies to include with Supabase API requests. No cookies are required.
Authentication
The method of authentication to use with Supabase. Select None
. Supabase authenticates requests using the API key or token you specified as a header value.
Forward all cookies
Whether to forward all cookies. This is useful if you have dynamic cookie names.
3. Save the resource
Click Create resource to complete the setup. You can then click either Create an app to immediately start building a Retool app or Back to resources to return to the list of resources.
Wrap up
Your Supabase resource is now ready to use. You write queries to make API requests by specifying the request method and endpoint, additional parameters to include, and the request body.
To verify you can successfully interact with Supabase, write a test query to retrieve some data. The following example retrieves all the data in a table.
GET https://<PROJECT_REF>.supabase.co/rest/v1/PROJECT_TABLE_NAME
[
{
"id": 1,
"vehicle": "truck",
"color": "green"
},
{
"id": 2,
"vehicle": "submarine",
"color": "orange"
},
{
"id": 3,
"vehicle": "plane",
"color": "blue"
}
]
Updated 13 days ago