Connect your app to Metabase
You can connect your Lovable app to Metabase to run your team's saved questions and custom queries. This lets your app display data and insights that your team already trusts and maintains in Metabase.
Anyone who wants their Lovable app to display data and reports curated in Metabase needs this.
Do this, in order
- 1
Sign in to your Metabase instance as an admin.
You need administrative access to create an API key and manage user groups.
- 2
Create a new Metabase group with limited permissions, giving it only the access your app needs for collections and data.
This is a security best practice to ensure the API key can only perform necessary actions and cannot accidentally modify sensitive data or settings.
- 3
Create a Metabase API key, assigning it to the limited-access group you just created.
This key will be used by Lovable to authenticate with your Metabase instance.
- 4
Copy the generated API key, which starts with 'mb_'.
Metabase shows this key only once, and you will need it for the Lovable connection form.
- 5
In Lovable, go to 'Connectors', select 'Metabase', and click 'Add connection' for an 'App + chat connector'.
This opens the form to set up the connection between Lovable and Metabase.
- 6
Enter your Metabase URL and the API key you copied into the connection form.
These credentials allow Lovable to securely access your Metabase instance.
- 7
Choose who in your Lovable workspace can use this connection.
This controls access to the Metabase data and functionality within Lovable projects.
- 8
Click 'Connect' to finalize the connection.
Lovable will verify the API key and establish the connection, making Metabase available for your projects.
Paste this into your project
Connect my app to Metabase. I need to run saved questions and custom queries. My Metabase URL is https://yourcompany.metabaseapp.com and my API key is mb_YOUR_API_KEY_HERE. I want to share this connection with my entire workspace.
Words decoded
- API key
- A unique code that acts like a password, allowing one computer program (Lovable) to securely access another program (Metabase) and use its features.
- Saved questions
- Pre-defined data queries and charts that your team has created and stored in Metabase for easy reuse and consistent reporting.
- Custom queries
- Specific data requests you write yourself, often using a language like SQL, to get exactly the information you need from a database.
- Business intelligence tool
- Software that helps people understand their business data by organizing, analyzing, and presenting it in easy-to-understand reports and dashboards.
Where people get stuck
- Using an API key with too many permissions, which could allow your app to accidentally change saved questions, dashboards, or even data if the underlying database user has write access.
- Not copying the API key immediately after creation, as Metabase shows it only once.
- Trying to connect to a Metabase instance that is not accessible over HTTPS on the public internet (e.g., on a private network).
- Expecting the Metabase connector to embed Metabase dashboards or charts directly; it only runs questions and queries, and your app renders the results.
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.