KBAISE/ for lovable
Library
Docs

Connect your app to the dbt Semantic Layer

about 10 minBuildingchecked 3d agoOfficial page
The short version

Connect your dbt Cloud account to Lovable to display official company metrics in your app. Your app can query dashboards and charts without anyone writing raw database queries.

Anyone building data dashboards or embedded analytics who needs to pull pre-defined metrics directly from dbt Cloud.

Do this, in order

  1. 1

    In dbt Cloud, navigate to Account Settings > Project > Semantic Layer to copy the GraphQL API host and your numeric environment ID.

    Lovable needs these specific endpoint details to locate your data environment.

  2. 2

    In dbt Cloud, open API tokens under Account settings and create a service token with 'Semantic Layer Only' and 'Metadata Only' permissions.

    This token grants your Lovable connection secure read-only access to query metrics.

  3. 3

    In Lovable, navigate to Connectors, select dbt Semantic Layer, and click Connect.

    This opens the integration form where you register the connection.

  4. 4

    Enter a display name, paste the bare hostname (without https://), enter the environment ID, and paste the service token starting with dbtc_.

    Lovable tests and validates these credentials against your dbt environment during setup.

  5. 5

    Set your sharing preferences to Private, specific members, or the entire workspace, then click Connect.

    This controls which team members can link this dbt data source inside their Lovable projects.

  6. 6

    In your Lovable project chat, ask the assistant to link the connection and build your metrics dashboard.

    The assistant connects your app code to the dbt gateway to query and display the metrics.

Paste this into your project

Use the dbt Semantic Layer and build a KPI dashboard that shows monthly revenue and active customers with filters by region.

Words decoded

dbt Semantic Layer
A centralized tool in dbt Cloud where data teams define business metrics once so every app uses the exact same calculation.
Dimensions
Categories used to group or slice your metrics, like country, plan type, or user role.
Time grains
The time intervals used to group data, such as daily, weekly, monthly, or quarterly.
Service token
A dedicated digital key that allows an application to read data without using an individual user's login.

Where people get stuck

  • Do not include 'https://' or extra URL paths in the Semantic Layer host field; provide only the bare hostname.
  • The connector is read-only: it cannot run dbt jobs, edit models, or query raw tables outside defined metrics.
  • dbt Core alone is not supported; you must have dbt Cloud on a plan that includes the Semantic Layer.
  • Queries consume dbt Cloud API usage and data warehouse compute, which are billed by your respective providers, not Lovable.

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.