Supabase Integration

Setting up Supabase Authentication in Databutton

Supabase integrations are for advanced use cases.

Databutton provides native authentication and database capabilities that are automatically included in all new Databutton apps. No additional setup required – simply start building your app and the infrastructure is ready. Native Authentication and Database

Setting Up Supabase Authentication via Frontend

Prerequisites

Before you begin, ensure the following are ready:

✅ Creating a Supabase Account

  • Sign Up: Go to the Supabase website and sign up using your email or a third-party provider like GitHub.

  • Create a New Project: Once logged in, click on "New Project," choose a name for your project, select a region closest to your location, and click "Create new project" to continue.

✅ Authentication: Enable email & password authentication in Supabase under Authentication > Providers

  • Navigate to the Authentication Tab: Go to the "Authentication" tab on the left sidebar in your Supabase project.

  • Providers: Go to the "Providers" tab, you will find the "Auth Providers" section.

  • Enable Email Sign-in: Toggle the switch to enable "Email" sign-in.

Ensure that if you enable "Confirm Email," a default rate limit on the maximum number of emails is applied. However, you can also toggle off this feature for testing purposes.

✅ Obtain Supabase API Credentials : Project Credentials: Get your Supabase Project URL and Public Anon Key from Home > Project API in the Supabase dashboard.

  • Navigate to the Project Home: In the Supabase dashboard, go to the "Home" tab of your project.

  • Grab the project API: Scroll down to find your project's API URL and anon/public key under "Project API." These are required to connect to your Supabase project.


Step 1: Set Up Supabase in Your App

Prompt to Set Up Supabase Client

Create a new task and copy/ paste this prompt:


Step 2: Add User Authentication

Prompt to Set Up Sign-Up & Sign-In

Copy and paste this prompt:


Step 3: Verify Authentication Setup and Debugging

Once authentication is added, test the following:

✅ Sign up with an email & password. ✅ Log in with the same credentials. ✅ Refresh the page—are you still logged in? ✅ Check if success/error messages appear correctly. ✅ Confirm navigation is working as expected.

If you face issues, try running this debugging prompt in Databutton AI:


Enabling Row-Level Security (RLS)

Once authentication is set up, make sure to implement Row-Level Security (RLS) to restrict data access to users' own records. This is critical for security and compliance.

To make it easy, the AI agent can generate SQL for you. Here’s an example SQL to ensure users can only access their own data:

You can copy and paste this SQL into the SQL editor in the Supabase dashboard under Database > SQL to apply RLS.

Learn more here.

Last updated

Was this helpful?