Connect to Supabase - Lovable Documentation
Documentation Index Fetch the complete documentation index at: /llms.txt Use this file to discover all available pages before exploring further. Skip to main content Assistant Responses are generated using AI and may contain mistakes. The Supabase integration connects a Supabase project you own to your Lovable project and uses it as your app’s backend. When connected, Lovable builds full-stack features directly from the project chat: it designs your database schema, runs migrations, deploys edge functions, and wires your app’s UI to your data, all against your own Supabase project.
Do I need Supabase? No. Lovable’s built-in backend is enabled by default, so most projects never need a separate Supabase account. It utilizes Supabase’s open-source foundation, so you get the same database, auth, storage, and edge function capabilities without any setup. Connect your own Supabase project when you want direct ownership of the backend: your own Supabase account and billing, full access to the Supabase dashboard, or an existing Supabase project you already use.
The Supabase integration is available on all plans. Supabase or the built-in backend? Built-in backend Your own Supabase project Setup Automatic, no extra account Requires a Supabase account and project Billing Credits in your Lovable workspace Your Supabase subscription, billed by Supabase Backend management The Database , Users , and Storage views inside Lovable Supabase dashboard Auth settings and social login providers Configured through Lovable Configured in the Supabase dashboard Infrastructure (backups, instance size, pausing) Managed by Lovable Managed by you in Supabase Best for Most projects, fastest path to a working backend Teams who want to own their Supabase account and infrastructure Switching between the two is not automatic.
Lovable does not move a project from the built-in backend to Supabase in one step, or the other way, so it’s worth deciding early which backend you want a project to use. See Export your database for details on exporting from the built-in backend. What you can build With Supabase connected, you can prompt Lovable to build complete backend features: Store and query data : Lovable designs tables and relationships from a plain-language description and connects your UI to them.
Sign users in : email and password authentication, social logins, and access control backed by Supabase Auth. Upload and serve files : images, documents, and other media stored in Supabase Storage buckets. Run server-side code : Supabase Edge Functions for payments, emails, AI features, scheduled tasks, and external API calls. Keep secrets safe : API keys for services like Stripe or Resend are stored securely in your Supabase project, never in your app’s code.
Update in real time : live chat, feeds, and dashboards using Supabase’s real-time subscriptions. For the full picture of everything the Supabase platform offers, see the Supabase documentation . Prerequisites A Supabase account. Sign up or sign in ; the free tier is enough to get started. A Supabase project to connect, or a Supabase organization where you can create one. Connect Supabase to Lovable Connecting involves two separate actions, often done by different people: Link a Supabase organization to your Lovable workspace.
A workspace owner or admin does this once per organization. Linked organizations become available to everyone in the workspace. Connect a Lovable project to a Supabase project. Anyone with edit access to the project can do this, using any project from a linked organization. If you’re a workspace owner or admin doing this for the first time, the connect dialog walks you through both actions in one flow. Link your Supabase organization (workspace owners and admins) You can link an organization from any of these places: The Supabase connector page : open Connectors from the dashboard sidebar, select Supabase , and click Connect Supabase (or Manage Connected Organizations if the workspace already has one).
The connect dialog in a project : in the editor, open Settings → General → External Supabase , click Connect , and use Add Organization . When creating a project : on the dashboard, click + in the prompt box, open Databases , and choose Add Supabase organization . Whichever you choose, a Supabase window opens where you sign in and authorize Lovable for the organization you pick. The organization then appears under Linked Supabase organizations and is available to every member of the workspace.
Members don’t need their own Supabase accounts to connect projects from it. Only workspace owners and admins can add or reconnect organizations. If these options are disabled for you, ask a workspace admin to link the organization first. Connect your Lovable project to a Supabase project When an organization is linked, anyone with edit access to a project can connect it. Start from either place: When creating a new project : on the dashboard, click + in the prompt box, open Databases , and pick a Supabase project under the Supabase heading (or type “Supabase” in the menu search).
The new Lovable project is created with that Supabase project as its backend. In an existing project : connect from the project’s settings in the editor: 1 Open the connect dialog In the editor, open Settings → General → External Supabase and click Connect . The option appears on projects that don’t have a backend yet. In the Linked Supabase organizations dialog, click Continue . 2 Choose a Supabase project The Connect project step lists the Supabase projects in your linked organizations.
Click Connect next to the project you want to use. Don’t have a Supabase project yet? Click Create Project to open the Supabase dashboard, create one there, and then return to Lovable to connect it. In this list and in the dashboard’s Databases picker, a warning icon next to a Supabase project means another Lovable project already uses it. Lovable projects that share one Supabase project overwrite each other’s secrets, including LOVABLE_API_KEY , so any feature that uses that key stops working.
You can still connect if the sharing is intentional. The Supabase view of a connected project shows the same warning. 3 Verify the connection After connecting, More → Supabase shows your Supabase project’s name and status, with quick links to the Supabase dashboard. You can now prompt Lovable to build backend features. If the connect link shows Wait for Lovable to finish working , Lovable is still processing a request in this project.
Wait for it to finish, then try again. Let Lovable create a Supabase project Lovable can create the Supabase project for you, in your own Supabase organization. Supabase bills the new project to that organization, not to Lovable. This works when all of these are true: The built-in backend is disabled for your workspace . When it is available, Lovable enables that instead. Your workspace has a linked Supabase organization .
Your Lovable project has no backend yet. Workspace admins and owners can do this. In the project chat, ask Lovable in Build mode to add a backend. Lovable asks you to approve the request before it creates anything. On the approval card, choose the Supabase organization and the region closest to your users. A project’s region cannot be changed after Lovable creates it. When your workspace has a required default data hosting region , Lovable uses that region and does not ask.
Click Create project . Creating the project can take several minutes. When it succeeds, Lovable connects the new project to your app and continues building. Lovable never deletes a Supabase project it created, including when the attempt fails partway through. After a failed attempt, open your Supabase organization and either connect the new project to your app or delete it there. Asking Lovable again does not create a second project for that app.
How Lovable works with your Supabase project With Supabase connected
The rest of this page is on the live site.