Connect Supabase to Refine

Learn how to connect your Supabase database to Refine and generate a working admin panel or dashboard in minutes.

Connect your Supabase project to Refine and get a working admin panel in minutes.

⏱️ Time to complete: ~5 minutes


What You'll Build

Refine reads your Supabase tables and generates a complete React application:

  • Data tables with sorting, filtering, and pagination
  • Create/edit forms matching your column types
  • Authentication using your Supabase auth setup
  • Full code ownership — export and deploy anywhere

Prerequisites

Before you start:

  • A Supabase account (sign up free at supabase.com)
  • A Supabase project with at least one table
  • A Refine account (sign up free at refine.dev)

Tip

Don't have a Supabase project yet? You can create one during setup, but you'll get better results if you have some tables and data already.


How to Connect

You can connect Supabase in two ways:

MethodWhen to use
From /startStarting a new project
From ConsoleAdding Supabase to an existing project

Option A: Connect from /start

Step 1: Start the connection

Go to refine.dev/start and click Connect to Supabase.

If you're not signed in, you'll be prompted to authenticate with Google or GitHub first.

Result: A modal opens asking you to connect your Supabase organization.


Step 2: Authorize Refine

  1. Click Add Organization
  2. You'll be redirected to Supabase
  3. Grant the requested permissions
  4. You'll return to Refine automatically

Tip

You can connect multiple Supabase organizations. Use the dropdown at the top of the modal to switch between them.

Result: Your Supabase projects appear in the modal.


Step 3: Select your project

You'll see your projects listed with:

  • Project name
  • Creation date
  • Status (Active/Inactive)

Click the project you want to connect.

Make sure your Supabase project is active, not paused. Paused projects won't connect.

Result: Refine starts analyzing your database.


Step 4: Wait for database analysis

Refine reads your database schema — tables, columns, relationships — and creates a Refine Schema Language (RSL) file. Think of RSL as a map that helps the AI understand your data structure.

Database SizeAnalysis Time
Small (< 20 tables)~1 minute
Medium (20-50 tables)~2 minutes
Large (50+ tables)Up to 5 minutes

You'll see a loading animation while this runs. Don't close the tab.

Result: The Resources page appears showing your schema.


Step 5: Review your resources

The Resources page displays your database structure:

  • Tables and their columns
  • Relationships between tables
  • Data types for each field

This confirms Refine understands your data. Take a quick look to make sure everything looks right.

Tip

If something looks wrong, click Regenerate to re-analyze your schema.

Result: You're ready to build.


Step 6: Start building

Click Continue to enter the Refine Console.

Now describe what you want in the chat:

Create an admin panel for my users table
Build a dashboard showing orders by status
Generate a CRUD interface for products with filters

Refine generates a working application connected to your Supabase data.

Result: A live preview of your application appears in the right panel.


Option B: Connect from Console

Already in a project? Connect Supabase from the Settings tab.

  1. Open Settings in the Console
  2. Go to Integrations
  3. Click Supabase
  4. Pick a project from the dropdown (or connect a new organization)
  5. Click Connect

The same OAuth and analysis flow runs. When complete, your project is connected.

Tip

Use this method to switch Supabase projects or add Supabase to a project you started with chat.


Empty vs Existing Databases

How the AI handles your database depends on whether it has data:

Database StateAI Behavior
Empty (no tables or data)AI creates tables, columns, and sample data for you
Has dataAI reads your schema but never writes to the database

Empty database

If your Supabase project is empty, the AI can:

  • Create tables based on what you're building
  • Set up relationships between tables
  • Add sample data to work with

This is great for rapid prototyping — describe what you want and let the AI scaffold everything.

Existing database

If your Supabase project already has tables or data, the AI will:

  • Read your schema to understand the structure
  • Generate UI that connects to your existing tables
  • Never create, modify, or delete anything in your database

The AI respects your data. It only reads the schema to generate the right code — all database operations happen through the generated app, not during code generation.


What Gets Generated

Data layer

Refine creates a Supabase data provider with:

  • Type-safe queries for your tables
  • Automatic relationship handling via foreign keys
  • Real-time updates (if enabled in Supabase)

UI components

Based on your column types:

Column TypeGenerated UI
text, varcharText input
integer, numericNumber input
booleanToggle switch
date, timestampDate picker
uuid (foreign key)Dropdown select
json, jsonbJSON editor

Authentication

If you have Supabase Auth configured:

  • Login/logout flows
  • Protected routes
  • User session handling

Refine respects your Row Level Security (RLS) policies. The generated app only shows data users are allowed to see.


After Connecting

Iterate with chat

Use the AI to refine your application:

  • "Add a status filter to the orders table"
  • "Make the email field required on the user form"
  • "Add a chart showing revenue by month"

Edit code directly

Switch to the Editor tab to modify the generated React/TypeScript code. It uses the Refine open-source framework — standard patterns you can customize.

Publish or export

When you're ready to ship:

  • Publish — Get a shareable link to your live app
  • Download (Pro) — Get a zip file of your complete project

The code is yours. No lock-in.


Troubleshooting

"Unable to connect to organization"

Common causes

  1. Permissions weren't fully granted during OAuth
  2. Your Supabase project is paused
  3. The Refine integration needs to be re-added

Fix: Go to Supabase → Settings → Integrations, remove Refine, then reconnect from refine.dev/start.


"Database analysis taking too long"

If analysis exceeds 10 minutes

  1. Check your Supabase project is responding (try the Supabase dashboard)
  2. Large schemas take longer — wait a bit more
  3. Contact support if it's stuck

"Tables not showing correctly"

Check these

  1. Every table needs a primary key
  2. Foreign key relationships should be defined in Supabase
  3. Try clicking Regenerate on the Resources page

Next Steps

On this page