KBAISE/ for lovable
Library
Docs

Connect to Supabase

about 5 minBuildingchecked 4d agoOfficial page
The short version

Connect your own Supabase project to Lovable if you want complete direct ownership and billing of your backend. Once linked, you can build databases, user sign-in, file uploads, and serverless functions directly through prompt chat.

Anyone who needs direct ownership of their database, existing Supabase setups, or full access to the Supabase dashboard instead of Lovable's built-in cloud backend.

Do this, in order

  1. 1

    Link your Supabase organization in Lovable by going to Connectors from the dashboard sidebar, picking Supabase, and clicking Connect Supabase (or Add Organization).

    A workspace admin must authorize the organization once so that everyone in the workspace can access its projects.

  2. 2

    In your Lovable project editor, go to Settings -> General -> External Supabase and click Connect.

    This starts the link between your current app interface and your remote backend project.

  3. 3

    Choose your desired Supabase project from the list and click Connect.

    This tells Lovable which database and backend services to manage for your app.

  4. 4

    Open More -> Supabase in the editor to verify the connection status and health.

    This confirms the connection succeeded and provides quick access links to your Supabase dashboard.

  5. 5

    Prompt Lovable to build your backend features and approve migration cards whenever prompted in chat.

    Lovable handles table schema creation, database migrations, and edge functions automatically against your Supabase project upon your approval.

Paste this into your project

Set up a user profile table in the connected database to store each user's display name and avatar URL, and ensure Row Level Security is configured so users can only view and update their own data.

Words decoded

Supabase
A platform that provides a complete backend, including a database, user login management, file storage, and serverless code.
Edge Function
A small script running on cloud servers instead of a user's web browser, useful for handling secret keys, emails, or payments.
Row Level Security (RLS)
Database security rules that restrict which specific rows of data a given user is allowed to read or edit.
Migration
A set of instructions that updates the structure or columns of your database tables.

Where people get stuck

  • Switching between Lovable's built-in backend and your own Supabase project cannot be done automatically; choose one early or you must recreate data manually.
  • Connecting multiple Lovable projects to the same Supabase project will cause them to overwrite each other's secrets, including LOVABLE_API_KEY.
  • Failing to implement Row Level Security (RLS) policies on your Supabase tables can leave sensitive user data open to the public.
  • Only workspace owners and admins can link a new Supabase organization to a Lovable workspace.

The short version, steps, decoder and prompt on this page are written automatically from Lovable's own documentation and can lag or misread it. The official page is always the authority.