Supabase Setup
You can either use Supabase OAuth for a quick and secure setup or connect using API Keys for self-hosted setups.
Connect with Supabase OAuth
To connect with Supabase using the OAuth method, follow the steps below:
- Open Settings & Integrations and go to the Supabase section.
- Select the Connect with Supabase OAuth tab.
- Click Connect to Supabase to start the connection flow.
- Choose your Supabase organization and authorize access.
- After authorization, either select an existing Supabase project or click Create New Project to make a new one.
- If creating a new project, enter the project name and region, then click Create.
- Copy and save the database password, since it will not be shown again.
- Click Done to finish the setup.
- Once connected, you can view and manage the Supabase project from the Supabase settings, switch projects, or open it in a new browser tab.
After creating or updating tables in your Supabase database, make sure to click Get Schema to refresh and sync the latest table structure in FlutterFlow.
Connect with Supabase API Keys
To connect using Supabase API Keys, you will manually link your Supabase project with FlutterFlow by providing the required credentials.
Please note that this method is only intended for self-hosted Supabase databases.
- First, create a project in Supabase from the Supabase dashboard.
- In your Supabase project, navigate to Project Settings > API. Copy the Project URL.
- Return to FlutterFlow, navigate to Settings and Integrations > Integrations > Supabase. Turn on the toggle (i.e., enable Supabase) and paste the API URL.
- Similarly, from the Supabase API section, copy the anon key (under Project API keys) and paste it inside the FlutterFlow > Settings and Integrations > Integrations > Supabase > Anon Key.
- Click on the Get Schema button. This will show the list of all tables with their schema (structure) created in Supabase.
- (Optional) If you have defined an Array for any Column Data Type in Supabase, you must set its type here. To do so, tap the "Click to set Array type" and choose the right one.
After creating or updating tables in your Supabase database, make sure to click Get Schema to refresh and sync the latest table structure in FlutterFlow.
Create Tables in Supabase
If you haven't already, create table(s). If you're just getting started, you can uncheck the Enable Row Level Security (RLS) option to remove any restrictions on accessing the table data.
It's important to note that while disabling Row Level Security (RLS) can be useful for testing and development purposes, it's recommended that you re-enable RLS and implement an access policy that aligns with your app's requirements before deploying your app.
Here's an example of creating an "assignments" table with a foreign key relationship from created_by column to public.users.id with on delete cascade. This ensures that if a user is deleted from the "public.users" table, any data related to that user stored in your "assignments" table will also be deleted.
To use Supabase authentication, you must create a "users" table.