In short.
This guide shows Lovable app builders how to use Cube business metrics in apps, but each connection shares one set of data permissions across all users. It covers model discovery, structured queries, Semantic SQL and authentication through Lovable's connector gateway. An existing Cube deployment is required, and Cube access rules must enforce any customer or role restrictions. Query charges can arise in Cube Cloud and the underlying warehouse; monetary prices are unknown. No connection, generated app or access restriction was tested.
Researched and written by an AI model and checked by a second AI model. How it works
Covers the complete captured page at [https://docs.lovable.dev/integrations/cube.md], including examples, connection methods, workspace controls, security warnings, costs, limitations, troubleshooting and connection management. Linked pages and the documentation index are excluded. No software, queries or application journeys were executed. Live behavior, monetary prices, version compatibility and unspecified reuse rights remain unknown.
The overview
Resource and scope
Connect your app to Cube is a Lovable documentation guide at [https://docs.lovable.dev/integrations/cube.md]. It explains how to connect Lovable to Cube, an analytics platform whose semantic layer holds shared definitions for business metrics.
The documented connector supports Cube Cloud and self-hosted Cube Core. A shared app + chat connection can be used in Lovable Chats, project chat while building, and published apps. The resource is instructional documentation rather than a downloadable connector package.
Fit and main tradeoff
The guide is useful for teams that already maintain metrics in Cube and want Lovable dashboards or reports to reuse those definitions. It provides concrete setup instructions and explains consequential details such as token expiry, shared access and query limits.
Its main constraint is the connection's fixed security context, meaning the customer or role information sent with every query. Every user querying through that connection receives the same access. A customer-specific dashboard can fit this design when Cube enforces that customer's restrictions, but a single connection cannot give individual app users separate data permissions.
Who it is for
The intended users are Lovable builders creating company dashboards, customer usage pages, metric explorers, glossaries, recurring reports or team scorecards. Data teams remain responsible for the Cube model and the rules that determine which rows queries may return.
Beginners receive form-by-form connection instructions and explanations of measures, dimensions and tokens. Experienced developers get details about JWT authentication, security-context claims, HTTPS requirements and credential revocation. The guide assumes a working Cube model; it does not teach how to build one from scratch.
What the connection supports
The connector can discover measures, such as revenue, and dimensions, such as region or month. It can run structured queries with measures, dimensions, time groupings, filters, sorting and row limits. Semantic SQL provides another query route when a structured query cannot answer the question.
The connection is read-only. Documented uses include charts, metric catalogs, quarterly trends and comparisons between reporting periods. Reusing Cube definitions can keep calculations consistent across tools, but the page provides no measured results establishing the correctness of a particular dashboard.
Using it
Prerequisites and workspace access
You need a Cube Cloud or Cube Core deployment with at least one cube or view, its API secret or an API token, and permission to create Lovable connections. The connector requires a public HTTPS hostname; Cube Core needs a valid certificate and typically a reverse proxy because its default service uses HTTP. Restricted networks must allow the Lovable gateway's IP ranges.
App + chat connectors are available by default, but workspace controls can restrict creation. Business and Enterprise plans initially limit creation to admins, while some Enterprise workspaces start with creation disabled. An admin or owner can change these controls. The page does not establish monetary plan requirements.
How queries and access work
Cube stores metric definitions in cubes and views and generates warehouse SQL from those definitions. When writing Cube code, Lovable reads the model first by default, prefers views, and usually creates structured queries. It uses Semantic SQL for questions that need it.
Requests pass through Lovable's connector gateway, which holds credentials and attaches a JSON Web Token, or JWT. Credentials are not exposed to the published app. By default, Cube validates the token using the deployment's API secret. Claims inside the token form the security context, which Cube access rules use to restrict returned data.
That context is shared across project chat and published apps, including all projects linked to the connection. In project chat, model reads, structured queries and Semantic SQL beginning with SELECT or WITH run without approval. Other requests can prompt for approval, even though the connector is read-only. Published apps do not ask for approval.
Connection setup
Open Cube in Lovable Connectors, add and name a connection, enter the deployment hostname, choose an authentication method, and configure sharing. Connections are private by default and can be shared with workspace members or the whole workspace. After connecting, link the connection to the intended project.
With the API-secret method, Lovable receives the deployment secret and signs a new token every hour. You can supply a security context such as {"tenant":"acme"}. It must be a JSON object no larger than 2 KB, with at most four nesting levels, and cannot contain exp, iat or nbf. Cube Cloud group and user-attribute claims belong inside a cubeCloud object.
With the API-token method, Lovable receives an existing token rather than the API secret. Tokens expiring in less than seven days are rejected; an accepted token with an expiry eventually stops working unless replaced. The guide suggests a non-expiring token to avoid that interruption. Secrets and tokens belong only in the connection form, never in chat or app code.
The connection check reads the data model. It does not establish whether customer or role restrictions work. After linking the project, run a query and inspect whether it returns only the intended rows.
Example application
One documented example is a monthly revenue and order-count dashboard with a status filter. Ask Lovable to build it using the existing orders view. Lovable should discover the actual measure and dimension names and query those definitions rather than recreate revenue calculations in the app.
For the customer-usage example, a connection can carry a context identifying Acme. Cube returns only Acme's rows if its data model enforces that restriction, and every app user sees data through that same context. These are documented examples; no dashboard was generated or run.
Assessment & evidence
Access, deployment and query limits
A connection cannot assign separate security contexts to individual app users. The connector also cannot reach deployments without a public HTTPS hostname, including private-network or IP-address-only endpoints. Its API-secret method cannot sign tokens using other verification keys; deployments using an identity provider need a suitable existing token instead.
Cube development mode is a critical exception to normal access enforcement. With CUBEJS_DEV_MODE=true, Cube answers queries even with an invalid token and applies no security context. Lovable's connection check can still pass.
Lovable normally adds a row limit to generated structured queries, but the page does not state that chosen limit. Without an explicit limit, Cube defaults to 10,000 rows; a query can request up to 50,000. The data team can change both Cube limits.
Deleting a Lovable connection does not revoke its Cube secret or pasted token. Revocation requires a Cube-side secret change or removal of an old secret from CUBEJS_API_SECRETS. Invalidating a secret also breaks other tools using tokens signed with it.
Why these constraints matter
The likely benefit is less duplication of metric calculations: Cube holds the definitions, while Lovable builds interfaces around them. That makes the guide especially relevant where an established Cube model already represents the business questions an app needs to answer. It does not establish the correctness of those definitions or the accuracy of generated queries.
The shared security context makes the intended audience a central design decision. Successful authentication proves neither correct customer filtering nor suitability for users with different access rights. This follows directly from the documented shared-context behavior and the limits of the connection check. Accuracy, latency, reliability and access isolation remain untested.
Documented choices
The guide offers two deployment choices: hosted Cube Cloud and self-hosted Cube Core. Both support the connector, while Core requires you to provide a suitable public HTTPS endpoint. It does not compare their operating effort or total cost.
Authentication also presents a choice. Sharing the API secret lets Lovable renew tokens hourly; supplying a token keeps the secret out of Lovable but leaves token replacement necessary if it expires. Other analytics connectors and approaches to per-user data access are not compared, so their relative suitability is not assessed.
Evidence and confidence
The evidence is the complete first-party Lovable documentation page at [https://docs.lovable.dev/integrations/cube.md]. It supports the described setup, authentication, query behavior and limitations as documented product behavior.
Linked Lovable and Cube pages were not included. There are no independent measurements, execution logs or demonstrated application results in the supplied evidence. No connection, query, credential flow or published app was executed.
Access & freshness
Charges and query quotas
The page says Lovable does not bill these Cube queries. Queries still consume Cube Cloud plan usage and warehouse processing, which the warehouse provider bills. This does not establish that Lovable, Cube Cloud or operating Cube Core is free; subscription prices, infrastructure costs and per-query amounts are unknown.
Some Cube Cloud plans impose daily query limits shared by all tools using the account. Frequently refreshing apps can exhaust that allowance, after which Cube Cloud stops queries. The applicable allowance and the cost of a particular dashboard are not supplied.
Licensing and reuse
The page describes Cube Core as open source but does not name its license or provide license terms. It also does not specify redistribution rights for the guide or licensing terms for the connector or generated application code. Those rights are unknown from this page alone.
Date and version limits
The documentation capture is dated 24 November 2026 at 04:40:29.982 UTC. The page supplies no publication date, last-updated date or specific connector or Cube version, so version-specific compatibility and the age of individual instructions are unknown.
Workspace controls, interface labels, token requirements and quotas are described as captured. Their current live behavior was not independently checked.
Before using it
Confirm that the existing Cube model contains the required metrics and that every intended app user may receive the connection's shared access. Check the public HTTPS endpoint, workspace permission and network allowlist before configuring credentials.
Choose the secret or token method according to your credential-sharing requirements, and enter credentials only in the connection form. Verify that the deployment enforcing access restrictions does not use CUBEJS_DEV_MODE=true. After linking, inspect representative query results to confirm the expected customer or role boundaries; a passing connection check is insufficient.
Estimate refresh frequency against the account-wide Cube query allowance and warehouse charges. Plan token replacement or coordinated secret rotation, remembering that deleting the Lovable connection alone does not revoke Cube credentials. These are recommended checks, not completed tests.
