# Supabase

> Give your app a database, user accounts, and a place to store uploaded files such as profile photos.

Web page: https://buildladder.com/tools/supabase

A reading list becomes more useful when people can close the app and find their books again tomorrow. With Supabase, each book can be a row in a database table. Signing in lets the app associate those rows with the person who saved them.

Start with two test accounts and a different book in each list. Set rules for who can read each row, then sign in as each reader. Each should see only the books they saved.

- Made by: Supabase
- Official site: https://supabase.com
- Cost: Free plan with up to 2 active projects and a 500 MB database each. Paid plans start at $25 a month.
- What you need first: A Supabase account.
- Who it helps: When your product needs to remember things between visits, or needs user accounts.
- When to skip it: If your product must stay online on the free plan. Free projects pause after a week with little activity, so move to a paid plan before you rely on it.
- Updated: 2026-11-10

## Save data with Supabase

Give your product a database so it remembers things between visits. Supabase keeps your data in tables, and access rules decide who can read and change each row.

What you’ll end up with: Your product saves and loads real data in Supabase. Each person can only reach the data they’re allowed to.

### You’ll need

- A website or app with PLAN.md in its folder.
- Your AI tool, set up and working in that folder.
- Sign-in in your product, if each person should see only their own data. The Sign-in concept compares the options.
- Supabase account (https://supabase.com/dashboard): Free plan with up to 2 active projects and a 500 MB database each. Paid plans start at $25 a month

### Your part

- Create the Supabase project, or reuse the one you made for sign-in.
- Read what each access rule does, then run the rules in Supabase.
- Test with two accounts to make sure people can’t see each other’s data.

### Step 1 of 5: Create or open your Supabase project

This step is mine to do. Walk me through it, one action at a time:
- If you already made a Supabase project for this product, for its database or its sign-in, open it at supabase.com/dashboard and skip the rest of this list.
- Otherwise, open supabase.com/dashboard and sign in or create an account. Choose the option that creates a new project.
- In the form, choose the organization that will hold it, and enter a name, such as your product’s name.
- Set a strong database password and save it in your password manager.
- If it asks for a region, pick the one closest to the people who will use your product.
- If the form offers access through Supabase’s Data API, keep it on.
- Create the project, then wait until its dashboard is ready.
- If you use Clerk for sign-in, do “Connect Clerk to Supabase” now that the project exists.

It worked when: You can see your Supabase project’s dashboard, the page where you manage it.

Before we move on, check with me:
- Is your database password saved somewhere safe?

If something goes wrong:
- It says you’ve reached the limit of free projects. The free plan allows 2 active projects. Pause one you don’t use, or use a project you already have.
- Your project is paused. Open it in the dashboard and unpause it.

### Step 2 of 5: Design your first table

Read PLAN.md in this folder. It has my plan and the tools I chose. I’m using Supabase for my database.

Help me design the first table, or the first few, for the must-have features only. Check Supabase’s current official docs first. Don’t rely on memory.

Explain in plain words:
- what each table holds, with an example row
- which columns it has, and what each one means
- which rows belong to one person, so we can keep them private

Wait for my yes. Then write the SQL that creates the tables in a file in this product, like a migration file. In the same file:
- turn on Row Level Security for every table
- add rules so signed-in people can only read and change their own rows, unless I said otherwise
- set only the grants each role needs, following Supabase’s Row Level Security guide
- give each rule a plain-English comment

Don’t run anything on my Supabase project. Tell me which file to copy, and I’ll run it myself.

It worked when: Your AI tool has described your tables in plain words and written one SQL file that creates them with access rules.

Before we move on, check with me:
- Does each table match something in your PLAN.md?
- Can you say in your own words who can see each table’s rows?

If something goes wrong:
- The plan has more than you expected. Say: “Keep only what the must-have features need. We can add more later.”
- You don’t know what should be private. Think about who should see each thing. Notes might be private, while a shop’s products are public. Tell your AI tool in plain words.

### Step 3 of 5: Set who can read and write

This step is mine to do. Walk me through it, one action at a time:
- Read the plain-English comments in the SQL file. If any rule surprises you, ask your AI tool to change it first.
- In your Supabase dashboard, open SQL Editor. Paste the whole file, then click Run.
- Open Table Editor and check that your new tables are there.
- For each table, check that Row Level Security is on and the rules match what you agreed with your AI tool.
- Open Security Advisor. If it lists a problem, copy the warning to your AI tool and ask for the smallest fix.
- Each time you add a table later, check Security Advisor again.

It worked when: Every table shows Row Level Security turned on, with rules you understand.

Before we move on, check with me:
- Does Security Advisor show no errors for your tables?

If something goes wrong:
- Running the SQL shows an error. Copy the whole error message to your AI tool. Ask: “What does this mean, and how do I fix the file?” Then run the fixed file.
- A table says Row Level Security is off. Anyone with your public key could read or change it. Ask your AI tool for SQL that turns it on with the right rules, then run it.

### Step 4 of 5: Save and load data in your app

Read PLAN.md again. My tables are now in Supabase, with Row Level Security turned on.

Connect my app to these tables. Check Supabase’s current docs for my kind of product first. Then:
1. If my app isn’t connected to Supabase yet, add the names for the project URL and publishable key to .env, with empty values. Make sure Git ignores .env, and tell me where to find each value. I’ll paste them in myself.
2. Use only the publishable key in the app. Never put the secret key in code that runs in a browser or on a phone.
3. Let people add, see, change and delete their own items, for the first must-have feature only.
4. Show a clear message if saving or loading fails, and a friendly message when nothing is saved yet.

Tell me what you’ll install or change before you do it. Keep everything that already works. When you’re done, give me a short list of things to try.

It worked when: Your product saves something, and it’s still there after you refresh the page or reopen the app.

Before we move on, check with me:
- In Table Editor, can you see the row you added?

If something goes wrong:
- Nothing saves, or the list is always empty. Row Level Security may be blocking it. Say: “Saving doesn’t work. Check my rules and grants against Supabase’s docs and fix the smallest thing.”
- It says “permission denied”. The table may be missing a grant. Copy the error to your AI tool and ask it to check the grants in Supabase’s Row Level Security guide.

### Step 5 of 5: Test with two accounts

This step is mine to do. Walk me through it, one action at a time:
- Sign in to your product as yourself and add two or three items.
- Sign out. Sign up as a second test person, using another email address you own.
- As the second person, check that the first person’s items don’t appear. Add one item of your own.
- Sign out and sign back in as yourself. Check that you only see your own items.
- Open Table Editor. Check that each row’s owner matches the account that added it.
- Write down anything that looked wrong, and fix it before real people use your product.

It worked when: Each test account sees only its own items.

Before we move on, check with me:
- Did your own items come back after you signed in again?

If something goes wrong:
- The second person can see the first person’s items. Stop and fix this first. Say: “My second test account can see the first account’s data. Check my access rules and code, and fix them.”
- The second account’s confirmation email doesn’t arrive. Add your second address to your Supabase team, or do “Send real emails with your own email service”.

Compare Supabase with the other options: https://buildladder.com/concepts/databases.md

## Add sign-in with Supabase

Let people create an account and sign in with their email or Google. Supabase keeps the accounts, and your AI tool builds the pages in your product.

What you’ll end up with: People can sign up, sign in with email or Google, and sign out. One page in your product is only for signed-in people.

### You’ll need

- A website or app with PLAN.md in its folder.
- Your AI tool, set up and working in that folder.
- Supabase account (https://supabase.com/dashboard): Free plan with up to 2 active projects and 50,000 monthly active users. Paid plans start at $25 a month
- Google Cloud account (https://console.cloud.google.com): It uses your Google account

### Your part

- Create the Supabase project and paste its keys into your .env file.
- Make Google sign-in keys in Google Cloud and paste them into Supabase.
- Sign up and sign in to check that it all works.

### Step 1 of 8: Create or open your Supabase project

This step is mine to do. Walk me through it, one action at a time:
- If you already made a Supabase project for this product, for its database or its sign-in, open it at supabase.com/dashboard and skip the rest of this list.
- Otherwise, open supabase.com/dashboard and sign in or create an account. Choose the option that creates a new project.
- In the form, choose the organization that will hold it, and enter a name, such as your product’s name.
- Set a strong database password and save it in your password manager.
- If it asks for a region, pick the one closest to the people who will use your product.
- If the form offers access through Supabase’s Data API, keep it on.
- Create the project, then wait until its dashboard is ready.

It worked when: You can see your Supabase project’s dashboard, the page where you manage it.

Before we move on, check with me:
- Is your database password saved somewhere safe?

If something goes wrong:
- It says you’ve reached the limit of free projects. The free plan allows 2 active projects. Pause one you don’t use, or use a project you already have.
- Your project is paused. Open it in the dashboard and unpause it.

### Step 2 of 8: Check email sign-in and web addresses

This step is mine to do. Walk me through it, one action at a time:
- In Supabase, open Authentication, then Sign In / Providers, and select Email.
- Check that Email is on. Keep email confirmation on, so people must confirm their address.
- Open Authentication, then URL Configuration. Set Site URL to the address your product opens at on your computer, like http://localhost:3000.
- Under Redirect URLs, add that address followed by /**, like http://localhost:3000/**. This lets Supabase send people to any page in your product.

It worked when: Email shows as on under Sign In / Providers, and your product’s address is saved in URL Configuration.

If something goes wrong:
- You don’t know your product’s address. Ask your AI tool: “What address does my app open at on my computer?”

### Step 3 of 8: Add sign-up and sign-in pages

Read PLAN.md in this folder. It has my plan and the tools I chose.

I want people to sign up, sign in and sign out with Supabase Auth. I have a Supabase project with email sign-in turned on.

Before you start:
- Look at my product and tell me how it’s built, in plain words.
- Check Supabase’s current official docs for this kind of product. Don’t rely on memory.
- Tell me what you’ll install and change, and wait for my yes.

Then:
1. If my app isn’t connected to Supabase yet, add the names it needs for the Supabase project URL and publishable key to .env, with empty values. Make sure Git ignores it. Tell me where to find each value in the Supabase dashboard. I’ll paste them in myself.
2. Read the keys only from environment variables. Use only the publishable key in the app. Never use the secret key in code that runs in a browser or on a phone.
3. Build a sign-up page and a sign-in page with email and password. Show clear messages when something goes wrong, like a wrong password.
4. Add a “Continue with Google” button. It won’t work until I finish Google setup, and that’s fine.
5. Add a way to sign out, and show who is signed in.

Keep everything that already works. When you’re done, explain what changed and give me a short list of things to try.

It worked when: Your product has sign-up and sign-in pages, and your .env file holds the two Supabase values.

Before we move on, check with me:
- Does the sign-up page show the form and the Google button?
- Does your AI tool confirm that Git ignores .env?

If something goes wrong:
- It says the API key is invalid, or it can’t reach Supabase. Copy the values again from the Connect button in your Supabase project. Check for extra spaces, then restart your product.
- You can’t find a publishable key. Open Settings, then API Keys, in your Supabase project. The publishable key starts with sb_publishable_.

### Step 4 of 8: Turn on Google sign-in

This step is mine to do. Walk me through it, one action at a time:
- In Supabase, open Authentication, then Sign In / Providers, and select Google. Copy the Callback URL shown there.
- In a new tab, open console.cloud.google.com. Create a project for your product, or pick one you already have.
- Open Google’s authentication setup for that Cloud project. If it asks, enter your product’s name and a contact email.
- In the OAuth client list, start creating a client. Choose Web application. A phone app needs this Web client too.
- Under Authorized JavaScript origins, add your product’s address, like http://localhost:3000.
- Under Authorized redirect URIs, paste Supabase’s Callback URL exactly. Then click Create.
- When Google shows the client ID and client secret, copy them into your password manager.
- Back in Supabase’s Google settings, turn Google on, enter the client ID and secret, and save.
- When you put your product online, add its live address under Authorized JavaScript origins, remove the localhost address, and switch your Google app to In production.

It worked when: Google shows as on under Sign In / Providers, and the Google button in your product opens Google’s sign-in screen.

If something goes wrong:
- Google shows a redirect_uri_mismatch error. The redirect URI in Google must match Supabase’s Callback URL exactly. Copy it again, with no extra spaces or slashes. Google says changes can take 5 minutes to a few hours.
- Some people can’t sign in with Google. Google’s Testing status limits access to listed test accounts unless the app only asks for name, email and profile. Other test authorizations expire after seven days. In Google’s authentication setup, check the audience and publishing status before you put your product online.
- Google’s screen shows an address ending in supabase.co. That’s normal at first. A custom domain for your Supabase project, or brand verification under Branding in Google, shows your own name instead.

### Step 5 of 8: Phone app only: make sign-in links open your app

This step is mine to do. Walk me through it, one action at a time:
- Ask your AI tool: “What URL scheme does my app have in app.json? If there isn’t one, add one, like myapp.”
- In Authentication, then URL Configuration, add your app’s scheme followed by ://** to Redirect URLs, such as myapp://**. Save the change.
- Ask your AI tool to make a development build, so you can test these links on your phone.
- Keep email confirmation on. If a link doesn’t open the app, confirm your email in the browser, then open the app and sign in.
- For native Google sign-in, create an OAuth client in Google Cloud for each phone platform you support. Your AI tool can find the identifiers those forms need.
- In Supabase’s Google settings, add the client IDs separated by commas: the Web ID first, then one for each phone platform. Save the change.
- Tell your AI tool: “This is an Expo app. Follow Supabase’s current Expo docs for deep links and for native Google sign-in. Save the session on the phone the way those docs do.”

It worked when: Redirect URLs lists your app’s scheme, like myapp://**, and Supabase’s Google settings list a client ID for the Web and for each phone platform.

If something goes wrong:
- Google sign-in does nothing in Expo Go. Native Google sign-in needs a development build. Expo’s guide says the Google sign-in library can’t run in Expo Go.
- You don’t know your SHA-1 fingerprint. Ask your AI tool: “Show me the SHA-1 fingerprint for my Android build, for testing and for the Play Store.” Supabase says to add both to Google.

### Step 6 of 8: Make a page for signed-in people only

Read PLAN.md again. I want one page that only signed-in people can see. If you don’t know which page, ask me first.

Check Supabase’s current docs for protecting pages in this kind of product. Then:
- If someone who isn’t signed in opens that page, send them to the sign-in page.
- After they sign in, take them back to the page they wanted.
- Hiding a link isn’t enough. The page itself must check who is signed in, the way Supabase recommends.

Keep everything that already works. Tell me what you changed, and how to test it while signed in and signed out.

It worked when: The page opens when you’re signed in, and sends you to sign in when you’re not.

If something goes wrong:
- The page opens even when you’re signed out. Say: “I’m signed out and the protected page still opens. Please find out why and fix it.”

### Step 7 of 8: Test sign-up, sign-out and Google

This step is mine to do. Walk me through it, one action at a time:
- Sign up with the email you use for Supabase. Supabase’s built-in email only sends to your Supabase team, and only 2 emails an hour.
- Open the confirmation email and click the link. You should land back in your product.
- Sign out. Then open your page for signed-in people. It should send you to sign in.
- Sign in with your email and password. That page should open.
- Sign out again. Click Continue with Google and pick your Google account.
- In Supabase, open Authentication, then Users. Check that your test sign-ups are listed.
- When you put your product online, add its live address in URL Configuration.

It worked when: Email sign-up, sign-out, sign-in and Google sign-in all work, and your test accounts appear in Supabase.

If something goes wrong:
- The confirmation email never arrives. Check your spam folder. If it isn’t there, wait an hour and try again.
- It says “Email address not authorized”. That address isn’t on your Supabase team. Test with your own address, or do “Send real emails with your own email service”.
- The email link opens a page that doesn’t load. Check Supabase’s Site URL and allowed redirect addresses against the address your product actually opens at. If you changed ports or domains, update those settings.

### Step 8 of 8: Send real emails with your own email service

This step is mine to do. Walk me through it, one action at a time:
- Pick an email service, like Resend, Amazon SES or SendGrid, and verify your domain there. Its Tool page has the steps.
- In that service, find its SMTP details: host, port, username and password.
- For Resend, the host is smtp.resend.com, the port is 465, the username is resend, and the password is a Resend API key.
- In Supabase’s authentication settings, open SMTP Settings and turn on custom SMTP.
- For the sender, enter an address on your verified domain that people can reply to, like hello@yourname.com, and your product’s name.
- Enter the host, port, username and password from your email service, then save.
- Supabase then allows 30 emails an hour at first. To send more, raise it under Authentication, then Rate Limits.
- Sign up with an address that isn’t on your Supabase team.

It worked when: An address outside your Supabase team gets the confirmation email, sent from your domain with your sender name.

If something goes wrong:
- It still says “Email address not authorized”. Custom SMTP isn’t saved yet. Open SMTP Settings again, check every field, and click Save.
- The emails land in spam. Finish verifying your domain in your email service. It gives you DNS records to add where you bought the domain.
- Sending fails after you saved. Check the host, port, username and password against your email service’s SMTP page. Make a new password or API key there if you’re not sure.

Compare Supabase with the other options: https://buildladder.com/concepts/sign-in.md
