Skip to content

08 — Core Data APIs, JS SDK, configuration, CLI and integrations ​

Pages read: 33 markdown pages plus 1 OpenAPI spec (specs/core-data.yaml). The full list is at the bottom.

All of this was checked against Cube Core v1.8.35 (container cubebi-cube, /cube/node_modules/@cubejs-backend/*) with read-only commands.

The route list in Core's api-gateway (api-gateway/dist/src/gateway.js), for reference throughout:

  • /readyz, /livez
  • {base}/graphql
  • {base}/v1/load (GET and POST), /v1/subscribe, /v1/sql, /v1/sql-filters, /v1/dry-run, /v1/convert-query
  • DELETE /v1/running-query/:requestId
  • /v1/meta, /v1/graphql-to-json, /v1/cubesql, /v1/cubesql/params
  • /v1/pre-aggregations/can-use, /v1/pre-aggregations/jobs
  • /cubejs-system/v1/{context, pre-aggregations, pre-aggregations/security-contexts|timezones|partitions|preview|build|queue|cancel}
  • {base}/v2/*, a proxy to the native (Rust) API gateway, enabled only when CUBEJS_NATIVE_API_GATEWAY is set

Not in Core: /v1/entities*, /v1/model-export, /v1/data-sources (the Metadata API), with zero matches in the image. There is also no MCP endpoint, and nothing for chat, LLMs or AI (see "MCP server").

Core Data APIs overview and authentication matrix ​

  • Docs: pages/reference/core-data-apis/index.md
  • What it does:
    • Four protocol families:
      • SQL (Postgres wire) for BI tools.
      • DAX/MDX for Excel and Power BI. The MDX API is referenced but not in this slice.
      • REST (JSON) and GraphQL for embedded apps.
      • MCP for AI assistants.
    • All APIs share the query concepts, security context and access policies.
    • Partial feature support:
      • Hierarchies and flat folders work only in Cube for Excel/Sheets and Playground.
      • Custom time formats work only in Playground and Workbooks.
    • Auth matrix:
      • User/password: SQL API and MDX API.
      • Kerberos/NTLM: MDX API only.
      • Identity provider: Cube for Excel and Cube for Sheets.
      • JWT: REST and GraphQL.
      • Personal Core Data API Token: SQL and REST.
    • Personal Core Data API Token:
      • Generated under Preferences → Personal Core Data API token.
      • Authenticates as the user, so groups, user attributes and data access policies apply.
      • It is not a JWT; the platform validates it before the deployment's JWT/JWKS/check_auth.
      • The page shows SQL API host, port and db, plus a curl sample.
  • Availability: CORE+CLOUD. No plan tier is stated.
    • REST, GraphQL, SQL and JWT auth: CORE.
    • Personal tokens, identity-provider auth, MDX/DAX/Kerberos/NTLM: CLOUD-ONLY.
      • Native evidence: no ntlm or DAX strings. xmla appears only as 2 stray matches, and the config docs only show req.protocol === 'xmla' in checkSqlAuth examples.
      • Personal tokens are validated by the "platform", meaning the Cloud control plane in front of the deployment.
  • Core building blocks to use: checkAuth (accept your own opaque personal tokens, look them up, return a security context), checkSqlAuth (map SQL user/password to a token or user record), contextToGroups, access policies.
  • To build on Core: a personal-token service (issue, hash, store, revoke tokens) plus a checkAuth/checkSqlAuth lookup, and a UI page showing connection details. S–M.
  • Gotchas: checkAuth replaces JWT verification entirely. To accept both JWTs and personal tokens, branch on token shape and call JWT verification yourself (e.g. jsonwebtoken with CUBEJS_API_SECRET/JWKS).

Querying concepts (defaults and query types) ​

  • Docs: pages/reference/core-data-apis/queries.md
  • What it does:
    • Default order (REST/GraphQL): first time dimension with granularity ascending, otherwise first measure descending, otherwise first dimension ascending. order: [] opts out.
    • SQL API ordering: no implicit order unless CUBESQL_SQL_NO_IMPLICIT_ORDER=false.
    • Row limits: default 10,000 (CUBEJS_DB_QUERY_DEFAULT_LIMIT), max 50,000 (CUBEJS_DB_QUERY_LIMIT). The SQL API streaming mode bypasses the max when there is an explicit LIMIT. CUBESQL_NON_STREAMING_QUERY_MAX_ROW_LIMIT caps non-streamed queries.
    • Time zone: UTC by default (CUBEJS_DEFAULT_TIMEZONE), with a per-query timezone. SQL_UTILS handles conversion for non-time-dimension columns. Per-account, per-user and per-dashboard time zones are Cloud UI features.
    • Query types:
      • Regular.
      • Post-processing (SQL only; DataFusion over a regular query).
      • Pushdown (SQL only; arbitrary SQL transpiled to the source; queryRewrite can only add filters).
      • compareDateRange (REST, queryType=multi).
      • Total (total: true).
      • Ungrouped (ungrouped: true). It requires primary keys of all cubes unless allowUngroupedWithoutPrimaryKey is set.
    • Troubleshooting: BI tools emitting HAVING COUNT(1) need a count measure on the cube or view.
  • Availability: CORE.
    • Image evidence: CUBESQL_SQL_NO_IMPLICIT_ORDER, CUBESQL_NON_STREAMING_QUERY_MAX_ROW_LIMIT and CUBESQL_SQL_PUSH_DOWN_PRE_AGGREGATIONS are in native/index.node, and allowUngroupedWithoutPrimaryKey is in server-core.
    • Only the Cloud time-zone-per-user/dashboard resolution is Cloud.
  • Core building blocks to use: REST /v1/load, SQL API, env limits, queryRewrite.
  • To build on Core: nothing. Per-user time zones = put the tz into the security context and set timezone on each query from your app (S).
  • Gotchas: the limit applies before post-processing, which can silently truncate (see SQL API). Ungrouped queries need primary keys.

REST (JSON) API: transport, scopes, CORS, cache control, Continue wait ​

  • Docs: pages/reference/core-data-apis/rest-api/index.md
  • What it does:
    • Transports: HTTP long-polling by default. WebSocket (CUBEJS_WEB_SOCKETS) at ws://host/cubejs-api/v1/ws:
      • The first message is {"authorization":TOKEN}.
      • Then {messageId, method, params}.
    • Base path: /cubejs-api (basePath). /livez and /readyz are unprefixed.
    • API scopes:
      • meta: /v1/meta, graphql-to-json, sql-filters (together with sql), cubesql/params (together with data).
      • data: /v1/load, /v1/cubesql.
      • graphql.
      • sql: /v1/sql.
      • jobs: /v1/pre-aggregations/jobs. This is the only scope off by default.
      • Scopes are set by CUBEJS_DEFAULT_API_SCOPES and, per request, by contextToApiScopes(securityContext, defaultScopes).
    • CORS: http.cors (express-cors options), default *.
    • Auth: JWT in Authorization (no Bearer needed). Dev mode skips auth.
    • Errors: 400 general, 403 missing/invalid token, 500 internal.
    • Request IDs:
      • x-request-id is ${spanId}-span-${seq}: 1–128 chars, charset-restricted, unpredictable. It falls back to traceparent.
      • An invalid ID returns 400.
    • Cache control via cache param:
      • stale-if-slow (default).
      • stale-while-revalidate.
      • must-revalidate.
      • no-cache.
    • Continue wait: a 200 with {error:"Continue wait"} after continueWaitTimeout (default 10 s, max 90). The client must retry; queries not re-polled become orphaned (orphanedTimeout 120 s).
  • Availability: CORE.
    • Image evidence: the routes and assertApiScope in gateway.js; throwContinueWait, x-request-id and traceparent handling in api-gateway; contextToApiScopes in server-core.
    • Cloud only adds "Status → API credentials" UI and request-span display in its monitoring.
  • Core building blocks to use: everything above.
  • To build on Core: nothing. For a platform: an API-gateway/proxy that injects tenant JWTs, plus request tracing that uses x-request-id (S).
  • Gotchas:
    • Numbers come back as strings.
    • jobs scope must be explicitly granted.
    • A custom x-request-id must be unguessable because it doubles as the cancellation handle.

REST (JSON) API: query format ​

  • Docs: pages/reference/core-data-apis/rest-api/query-format.md
  • What it does:
    • Query object: measures, dimensions, segments, filters, timeDimensions, limit, offset, total, order (object or array of tuples), timezone, ungrouped, joinHints (array of cube-name pairs).
    • Member names: cube.member, and cube.time.granularity for custom granularities. An array of queries means data blending.
    • Filter operators:
      • Equality and comparison: equals, notEquals, gt, gte, lt, lte (numeric values must be strict JSON decimals, validated by Tesseract).
      • String matching: contains, notContains, startsWith, notStartsWith, endsWith, notEndsWith (case-insensitive ILIKE; the not-variants include NULLs unless null is passed).
      • Null checks: set, notSet.
      • Date operators: inDateRange, notInDateRange, beforeDate, beforeOrOnDate, afterDate, afterOrOnDate. They accept a single-element relative string such as ["last 2 weeks"].
      • measureFilter: used by drilldown; not pre-aggregation compatible.
    • Logical groups: and/or are nestable but cannot mix dimension and measure filters. Date filters inside an or are scoped to that branch.
    • timeDimensions: {dimension, dateRange | compareDateRange, granularity}. dateRange accepts relative strings, parsed with Chrono, e.g. last quarter or from 7 days ago to now. Only timeDimensions.dateRange drives pre-aggregation time matching; filter-based date operators do not.
  • Availability: CORE. The spec V1LoadRequestQuery fields match, date-parser.js is in api-gateway, and joinHints and responseFormat are handled in gateway.js.
  • Core building blocks to use: /v1/load.
  • To build on Core: nothing. A query-builder UI or LLM tool would emit this JSON.
  • Gotchas:
    • A timeDimensions range and an or-scoped date filter on the same member are AND-ed.
    • The deprecated legacy planner doesn't validate numeric values.

REST (JSON) API: endpoint reference (load, sql, convert-query, sql-filters, meta, cubesql, params, running-query, pre-aggregation jobs, health) ​

  • Docs: pages/reference/core-data-apis/rest-api/reference.md, specs/core-data.yaml
  • What it does:
    • /v1/load:
      • Params: query, queryType=multi, cache, responseFormat (default/compact {members,dataset}/columnar {members,columns}).
      • Response: data, annotation (title, shortTitle, type, format), lastRefreshTime, external, usedPreAggregations (preAggregationId, lastUpdatedAt, type), total.
      • targetTableName/refreshKeyValues are returned only in dev mode.
    • /v1/sql: returns the generated SQL and params for REST queries (format=rest) or SQL queries (format=sql, with query_type regular/post_processing/pushdown). disable_post_processing is optional.
    • /v1/convert-query (POST {input:"sql", output:"rest", query}): converts SQL API queries to the REST JSON format. Errors if post-processing or multiple queries are needed.
    • /v1/sql-filters:
      • GET reads the planner-resolved filters of a SQL query.
      • POST rewrites the outermost SELECT with exactly one of add/set/delete/replace. Limits: 500 filters and 10,000 values.
      • Needs both the sql and meta scopes.
      • This is the building block for dashboard filter bars over SQL-defined charts.
    • /v1/meta: cubes and views (public only, unless dev mode or a playground-signed token) with measures, dimensions (switch reported as string with values), hierarchies, segments, folders/nestedFolders and connectedComponent. Spec fields: format, formatDescription (d3 specifier, currency), aliasMember, granularities, drillMembers, cumulative, synthetic (<measure>___format dynamic formats).
    • /v1/cubesql:
      • Body: {query, timezone, cache, responseFormat default|columnar, params:[{name,value,type number|string|time|boolean|expr}]} with :name placeholders.
      • Responds with NDJSON: first schema (+lastRefreshTime, usedPreAggregations), then data chunks of up to CUBESQL_CUBE_SCAN_MAX_BATCH_ROWS rows.
    • /v1/cubesql/params: lists :name params with their inferred types.
    • DELETE /v1/running-query/{requestId}: cancels in-flight queries by x-request-id across all queues.
    • /v1/pre-aggregations/jobs (Orchestration API, jobs scope):
      • action:post with selector{contexts[{securityContext}], timezones, dataSources, cubes, preAggregations, dateRange, force (default true), dryRun} returns tokens.
      • dryRun returns partition statuses done|outdated|missing_partition.
      • action:get with tokens returns scheduled|processing|done|failure: <err>|missing_partition|not_found|pre_agg_not_found. Records are kept for 24 h.
      • Builds run in the receiving process.
    • /readyz tests the default data source; /livez tests existing connections.
    • Also in Core but undocumented here: /v1/dry-run, /v1/pre-aggregations/can-use and the /cubejs-system/v1/* pre-aggregation admin routes (used by Cloud UI and Playground).
  • Availability: CORE for every endpoint above. All routes are present in gateway.js 1.8.35, and missing_partition/pre_agg_not_found/dryRun are in server-core/dist/src/core/RefreshScheduler.js.
  • Core building blocks to use: these are the building blocks.
    • /v1/sql-filters plus /v1/cubesql give SQL-defined charts with interactive filters.
    • /v1/convert-query maps an LLM-generated SQL query to a REST query.
    • /v1/pre-aggregations/jobs drives a custom pre-aggregation management UI.
    • running-query drives a cancel button.
  • To build on Core: nothing for the API itself. A platform layer (auth proxy, query history and logging keyed on request IDs) is S–M.
  • Gotchas:
    • /v1/meta hides public:false members even from admins; there is no include_private in Core.
    • expr params are raw SQL, so never pass untrusted input as expr.
    • usedPreAggregations names leak to every API consumer.

Metadata API (entities, model-export, data-sources) ​

  • Docs: pages/reference/core-data-apis/rest-api/reference.md#metadata-api
  • What it does:
    • GET /v1/data-sources returns name, type, database, schema and properties, with no credentials.
    • GET /v1/entities returns a paged list of type/name/public. GET /v1/entities/{name} and POST /v1/entities/all return the full entity:
      • title, description, meta
      • table_references and cube_references
      • joins (relationship plus join SQL; omitted under DAP)
      • members with sql, is_primary_key, member_references and column_references (lineage)
    • include_private requires the meta-private scope, which only Control-Plane tokens-for-meta-sync can mint.
    • POST /v1/model-export dumps everything, including DAP-hidden members, for catalogs.
    • Lineage for sql: cubes is parsed from the SQL; column lineage works only for SELECT * FROM single_table.
  • Availability: CLOUD-ONLY. The docs say "Metadata API is only available in Cube Cloud". There are no matches for model-export, v1/entities, v1/data-sources or meta-private anywhere in @cubejs-backend 1.8.35.
  • Core building blocks to use:
    • GET /v1/meta?extended, which is undocumented but present in Core. api-gateway/dist/src/helpers/transform-meta-extended.js adds to each cube sql, extends, fileName and refreshKey; to each member its raw sql, measure filters and dimension case; plus joins and preAggregations. This is about 70% of the entity payload.
    • The schema-compiler evaluator, used in-process, for primary keys.
    • repositoryFactory for raw files.
  • To build on Core: a service on top of /v1/meta?extended that normalizes the output into the entity shape and adds a SQL parser (e.g. sqlglot) for table_references and column_references, plus its own meta-private scope and pagination. M.
  • Gotchas:
    • Respecting access policies in lineage needs the same contextToGroups and policy evaluation Core uses.
    • Join SQL can reveal hidden columns.

SQL API (Postgres wire protocol): setup, planning, streaming, sessions, cache ​

  • Docs: pages/reference/core-data-apis/sql-api/index.md
  • What it does:
    • Setup:
      • Off in Core until CUBEJS_PG_SQL_PORT is set.
      • Credentials come from CUBEJS_SQL_USER/CUBEJS_SQL_PASSWORD. Any database name works.
      • Custom auth via checkSqlAuth, canSwitchSqlUser and CUBEJS_SQL_SUPER_USER.
      • Also usable over HTTP via /v1/cubesql.
    • Model mapping: each cube or view is a table, and members are columns. information_schema and psql \d introspection work.
    • Planning: Apache DataFusion plus egg e-graph rewriting. A query is tried as regular, then post-processing, then pushdown.
    • Streaming: CUBESQL_STREAM_MODE=true streams from the source. Streamed queries bypass Cube Store pre-aggregations.
    • Sessions: CUBEJS_MAX_SESSIONS caps them.
    • Cache: SET cube_cache = 'must-revalidate' etc.
    • Planner limits: CUBESQL_REWRITE_MAX_NODES, _MAX_ITERATIONS and _TIMEOUT handle "Can't find rewrite".
    • Cloud specifics:
      • On by default on port 5432 with user cube.
      • Connections are recycled after 8–12 min with 57P01 admin_shutdown, for autoscaling.
  • Availability: CORE+CLOUD.
    • Core: the whole engine. CUBESQL_STREAM_MODE, CUBEJS_MAX_SESSIONS, cube_cache, CUBESQL_REWRITE_MAX_NODES and 57P01 are in native/index.node.
    • Cloud: default enablement, credential UI, managed connection recycling with autoscaling, and Personal-token auth.
    • Warning on the page: CUBEJS_DEV_MODE=true without CUBEJS_SQL_PASSWORD accepts any credentials.
  • Core building blocks to use: CUBEJS_PG_SQL_PORT, checkSqlAuth, canSwitchSqlUser, contextToAppId, access policies.
  • To build on Core: a TCP load balancer for many replicas. Optionally, per-user SQL credentials stored in your platform and checked in checkSqlAuth. S.
  • Gotchas: never expose a dev-mode instance. Behind an L4 load balancer without recycling, long-lived BI connections pin to old replicas.

SQL API: query format, post-processing vs pushdown, row-limit edge case ​

  • Docs: pages/reference/core-data-apis/sql-api/query-format.md
  • What it does:
    • Measures: wrapped in MEASURE() or the type-matching aggregate:
      • avg takes AVG; count takes COUNT; count_distinct and count_distinct_approx take COUNT(DISTINCT).
      • min/max take MIN/MAX; sum takes SUM; string takes STRING_AGG; time takes MAX/MIN; number takes any of these.
    • Segments: boolean columns.
    • Post-processing and pushdown:
      • Expressions over dimensions (e.g. CASE as a grouping key) need pushdown (CUBESQL_SQL_PUSH_DOWN, on by default). Otherwise they fail with "Can't detect Cube query".
      • Workaround: nest the query, with the inner query being a regular query and the outer doing post-processing.
      • UNIONs on one data source are pushed down, except on Druid, ksqlDB and SQLite.
    • Evaluation order: top-down measure evaluation through ungrouped subqueries. An inner SELECT without GROUP BY is deferred to the outer GROUP BY.
    • Non-aggregated queries: with pushdown on, these run as ungrouped queries.
    • Row-limit edge case: post-processing over a regular query that was truncated at 50k gives silently wrong results. Use EXPLAIN (CubeScanExecutionPlan, Request: vs SQL:) to check. Workarounds: explicit LIMIT, raise CUBEJS_DB_QUERY_LIMIT, or stream mode.
  • Availability: CORE (native cubesql).
  • Core building blocks to use: SQL API and EXPLAIN.
  • To build on Core: nothing. An AI or SQL-runner product should run EXPLAIN and warn on truncation (S).
  • Gotchas: the silent-truncation behaviour above. Non-additive measures can't be re-aggregated in outer queries.

SQL API: commands and function reference ​

  • Docs: pages/reference/core-data-apis/sql-api/reference.md
  • What it does:
    • Commands:
      • SELECT (CROSS JOIN, DISTINCT ON, UNION [ALL]).
      • EXPLAIN [ANALYZE].
      • SHOW/SET (cube_cache, SET TIME ZONE).
      • CREATE TEMPORARY TABLE (session-scoped, joinable with cubes; capped by CUBESQL_TEMP_TABLE_SESSION_MEM, 10 MiB, and _TOTAL_MEM, 100 MiB).
      • COPY … FROM STDIN (text/csv), to load user data such as targets into temp tables.
    • Functions: a matrix of pushdown vs post-processing (outer, inner selections, inner projections) support covering comparison, math, trig, string, regex (REGEXP_SUBSTR), TO_CHAR, date/time, conditional, aggregates (including PERCENTILE_CONT, APPROX_*), statistics, window functions (ROW_NUMBER…LEAD), and IN.
    • Custom functions: XIRR.
    • Dialect limits:
      • WIDTH_BUCKET pushdown is unavailable on many dialects.
      • SPLIT_PART pushdown works only on Redshift, CrateDB, Cube Store, Databricks, Dremio, DuckDB, Firebolt, Materialize, Postgres and Snowflake.
      • DATE_TRUNC takes default granularities only.
  • Availability: CORE. TEMPORARY, COPY, XIRR and CUBESQL_TEMP_TABLE_SESSION_MEM are present in native/index.node.
  • Core building blocks to use: the SQL API. Temp tables plus COPY allow "upload a CSV and join it to the model" in a custom UI.
  • To build on Core: nothing.
  • Gotchas:
    • Temp-table memory is small and per server.
    • Window functions in post-processing are subject to the row-limit edge case.

SQL API: joins (views, CROSS JOIN, __cubeJoinField, multi-fact) ​

  • Docs: pages/reference/core-data-apis/sql-api/joins.md
  • What it does:
    • Views are the recommended join paths. Only the needed members are materialized, and fan and chasm traps are handled.
    • Cube-to-cube joins: CROSS JOIN or JOIN … ON a.__cubeJoinField = b.__cubeJoinField act as join hints using the model's joins. Transitive joins are allowed, and there are no joins in the plan.
    • Shared-dimension view joins: joining two views on the same underlying member while grouping by it gives one aggregating subquery per view, stitched together. JOIN type controls which keys are kept.
    • Multi-fact pattern: one CTE per view, aggregated by the shared dimension, then joined. Filters go inside the CTEs. With pushdown on this is a single SQL statement; otherwise post-processing.
  • Availability: CORE. __cubeJoinField is in native.
  • Core building blocks to use: SQL API and views.
  • To build on Core: nothing.
  • Gotchas: re-aggregating the joined CTEs is valid only for additive measures.

SQL API: authentication, security context switching, __user ​

  • Docs: pages/reference/core-data-apis/sql-api/security.md
  • What it does:
    • checkSqlAuth(req, user, password):
      • Returns {password, securityContext, superuser?}. The returned password is compared to the client's.
      • Called on connect, on user change, and every CUBESQL_AUTH_EXPIRE_SECS. password is absent on re-auth.
    • User switching:
      • CUBEJS_SQL_SUPER_USER or canSwitchSqlUser(current, new) allow switching user.
      • Switching happens via SET USER or the virtual filter WHERE __user = 'x', e.g. Preset RLS passing the viewer.
    • Per-team models: contextToAppId combined with COMPILE_CONTEXT in Jinja/YAML gives per-team masked models.
    • Session visibility: pg_stat_activity hides other users' query text unless the user and security context match or the user is a superuser.
  • Availability: CORE. checkSqlAuth/canSwitchSqlUser are in server-core and api-gateway sql-server.js (superuser), and __user is in native.
  • Core building blocks to use: these hooks.
  • To build on Core: a credentials store for per-user SQL passwords plus a BI-tool service user with __user impersonation (S).
  • Gotchas:
    • checkSqlAuth must handle a missing password.
    • A superuser can impersonate anyone, so lock it down.

Configuration file (cube.js / cube.py): data model & multitenancy options ​

  • Docs: pages/reference/configuration/config.md (Data model section)
  • What it does:
    • The config file is cube.js or cube.py. cube.ts is no longer supported and fails at startup. Every hook can be sync or async.
    • schemaPath: the model directory, default model (env CUBEJS_SCHEMA_PATH).
    • contextToAppId(ctx): the key for the compiled model. Each id gets its own compile, which enables COMPILE_CONTEXT and a per-tenant repositoryFactory. Called on every request. On its own it does NOT isolate cache or queues.
    • repositoryFactory(ctx): returns FileRepository(path), or {dataSchemaFiles: async () => [{fileName, content}]} to serve files from a DB or API. Called once per app id.
    • schemaVersion(ctx): a version string. When it changes, the model recompiles. Called on every request.
    • Compiler cache options:
      • compilerCacheSize: default 250 LRU entries (env CUBEJS_COMPILER_CACHE_SIZE).
      • maxCompiledMembers: bounds the cache by member count.
      • maxCompilerCacheKeepAlive and updateCompilerCacheKeepAlive: TTL and sliding TTL.
      • allowJsDuplicatePropsInSchema.
  • Availability: CORE. Every option name is present in server-core/dist (grep counts 2–6 each).
  • Core building blocks to use: these options form the multitenancy foundation.
  • To build on Core: a model store (DB or Git) served via repositoryFactory, with schemaVersion driven by a store revision, gives Cloud-style "model versioning and branches". M.
  • Gotchas:
    • Per-tenant pre-aggregation schemas need contextToAppId, because the schema is resolved per app id.
    • schemaVersion must be cheap and stable; returning random values recompiles on every request.

Configuration: query cache, queue & orchestration (multitenant isolation) ​

  • Docs: pages/reference/configuration/config.md (Query cache & queue)
  • What it does:
    • cacheAndQueueDriver: memory or cubestore. Code note: the production default is triggered by NODE_ENV=production, not by dev mode. Redis was removed in 0.36 and is only detected so Core can throw an error.
    • contextToOrchestratorId: per-tenant DB connections, queues and result cache. Pair it with preAggregationsSchema to avoid table clashes.
    • contextToCubeStoreRouterId: routes tenants to different Cube Store routers. Requires contextToOrchestratorId.
    • contextToPreAggregationOrchestratorId: shares pre-aggregation queues, caches and cleanup across orchestrators, e.g. per region. Refresh-key queries get their own queue.
    • driverFactory({securityContext, dataSource}):
      • Returns {type, ...driver options} or a custom driver instance. Called once per data source per orchestrator id.
      • CUBEJS_DATASOURCES must list every source it serves.
      • It overrides the CUBEJS_PRE_AGGREGATIONS_* connection.
    • orchestratorOptions:
      • continueWaitTimeout: 10 s, max 90.
      • rollupOnlyMode.
      • queryCacheOptions: refreshKeyRenewalThreshold, backgroundRenew, queueOptions.
      • preAggregationsOptions: maxPartitions 10000, queueOptions, externalRefresh.
      • Queue options: concurrency, executionTimeout 600, orphanedTimeout 120, heartBeatInterval 30.
      • The docs discourage these and point to CUBEJS_ROLLUP_ONLY, CUBEJS_DB_QUERY_TIMEOUT and CUBEJS_CONCURRENCY instead.
  • Availability: CORE. All present in server-core; detectQueueAndCacheDriver is in query-orchestrator/dist/src/orchestrator/QueryOrchestrator.js.
    • The Cloud part is "Multi-router Cube Store" and multi-cluster infrastructure, which is what makes contextToCubeStoreRouterId useful.
  • Core building blocks to use: these hooks plus a tenant registry.
  • To build on Core: a tenant registry holding per-tenant DB credentials in a secrets store, read by driverFactory. Several Cube Store clusters if needed. M, or L with a multi-router Cube Store.
  • Gotchas:
    • If one driverFactory connection serves both queries and pre-aggregations, you can't split read and write credentials.
    • Each orchestrator id holds its own connection pools, so memory grows with tenant count.

Configuration: pre-aggregations & scheduled refresh ​

  • Docs: pages/reference/configuration/config.md (Pre-aggregations)
  • What it does:
    • preAggregationsSchema:
      • A string or fn(ctx), resolved once per app id.
      • Defaults: dev_pre_aggregations / prod_pre_aggregations.
      • Cube wipes this schema, so it must be dedicated to Cube.
      • Cloud shares one schema across environments; on Core, use separate schemas.
    • scheduledRefreshTimer:
      • This is a heartbeat, not a freshness setting.
      • It is enabled via CUBEJS_REFRESH_WORKER, and it is best to run it in a separate worker.
      • CUBEJS_SCHEDULED_REFRESH_TIMER_INTERVAL_ONLY makes a numeric value set only the interval.
    • scheduledRefreshTimeZones: an array or fn, default ['UTC']. It affects pre-aggregation matching.
    • scheduledRefreshContexts(): returns [{securityContext}], one per tenant. Without it the security context is undefined during refresh.
  • Availability: CORE. scheduledRefreshTimer, TimeZones, Contexts, Concurrency and BatchSize are all in server-core.
    • Cloud adds the managed refresh worker, the Pre-Aggregations UI and shared Cube Store.
  • Core building blocks to use: scheduledRefreshContexts fed from the tenant registry, /v1/pre-aggregations/jobs, /cubejs-system/v1/pre-aggregations/*.
  • To build on Core:
    • A separate refresh-worker deployment.
    • A pre-aggregation status and build UI over the jobs API (M).
  • Gotchas:
    • Setting the timer on every API replica causes refresh races and OOMs.
    • extendContext is not applied in the refresh worker.

Configuration: querying hooks & security (queryRewrite, ungrouped, auth, groups) ​

  • Docs: pages/reference/configuration/config.md (Querying, APIs)
  • What it does:
    • queryRewrite(query, {securityContext}):
      • Called on every request. Can add filters (row-level security) or throw to deny.
      • Throwing returns 500 in Core and 403 in Cloud (issue #8136).
      • Has no built-in access to model metadata (issue #4118).
      • For SQL pushdown, only adding filters is supported.
    • allowUngroupedWithoutPrimaryKey: turned on automatically when CUBESQL_SQL_PUSH_DOWN is set.
    • basePath, http.cors, webSocketsBasePath, processSubscriptionsInterval: API surface settings.
    • contextToApiScopes(securityContext, defaultScopes): scopes per request.
    • extendContext(req): merges extra data into the request context, e.g. from headers. Also define contextToAppId so the extra values are reflected in the app id.
    • checkAuth(ctx, token):
      • Replaces default JWT verification.
      • Return {security_context} or throw. An empty function disables auth.
    • jwt: {jwkUrl (string|fn), key, algorithms, issuer, audience, subject, claimsNamespace}, mirrored by the CUBEJS_JWK_URL / CUBEJS_JWT_* env vars.
    • checkSqlAuth(req, user, password):
      • req.protocol and req.method identify the protocol (e.g. xmla/ntlm in Cloud).
      • Returns {password, securityContext, superuser}.
    • canSwitchSqlUser(current, new).
    • contextToGroups(ctx): returns groups used to match access policies' group/groups.
  • Availability: CORE. All present in server-core and api-gateway.
    • Access policies (access_policy in the model, row and member level) are implemented in schema-compiler (CubeEvaluator.js, CubeValidator.js, ViewCompilationGate.js) and server-core/dist/src/core/CompilerApi.js. The mask env vars CUBEJS_ACCESS_POLICY_MASK_* are in shared/env.js.
    • Cloud adds UI-managed groups, user attributes and SSO that populate the security context.
  • Core building blocks to use: this is the security core: JWT/JWKS from your IdP, then contextToGroups, then access_policy, plus queryRewrite for anything custom.
  • To build on Core:
    • Identity service: IdP/OIDC to JWT with groups and attributes claims.
    • Admin UI for groups and attributes.
    • Policy authoring in the model.
    • M–L in total.
  • Gotchas:
    • Policies in the model are code, so changing them means changing the model.
    • queryRewrite errors surface as 500s.

Configuration: utility (logger, telemetry) and undocumented/Cloud hooks present in Core ​

  • Docs: pages/reference/configuration/config.md (Utility)
  • What it does:
    • logger(message, params):
      • The custom log sink.
      • When CUBEJS_LOG_REDACTION is on (the default in production), filter values, SQL params and literals are redacted.
      • Usable as a query-history feed.
    • telemetry: anonymous dev-mode usage stats (CUBEJS_TELEMETRY).
    • Also present in the Core validator but not documented on the page:
      • dialectFactory, externalDriverFactory, externalDialectFactory
      • queryTransformer (the legacy name of queryRewrite)
      • contextToDataSourceId
      • devServer, fastReload, livePreview, sqlCache
      • semanticLayerSync: joi.func() in server-core/dist/src/core/optionsValidate.js:139, accepted but never called in Core.
  • Availability: CORE for logger and telemetry.
    • semanticLayerSync is a dead hook in Core; the sync itself is Cloud.
    • CUBEJS_AGENT_ENDPOINT_URL (shared/env.js, server-core/dist/src/core/server.js) ships logs to Cloud's Query History collector.
  • Core building blocks to use: a logger hook or CUBEJS_AGENT_ENDPOINT_URL pointed at your own collector to build Query History.
  • To build on Core: a log collector plus a query-history store and UI. M.
  • Gotchas: with redaction on, filter values are not recoverable from logs.

Environment variables ​

  • Docs: pages/reference/configuration/environment-variables.md (258 documented variables)
  • What it does (grouped):
    • Server and API:
      • PORT (4000), CUBEJS_APP, CUBEJS_SCHEMA_PATH.
      • CUBEJS_MAX_REQUEST_SIZE (50mb), CUBEJS_SERVER_*_TIMEOUT, CUBEJS_WEB_SOCKETS.
      • CUBEJS_DEFAULT_API_SCOPES (default meta,data,graphql,sql; jobs excluded).
      • Query limits: CUBEJS_DB_QUERY_DEFAULT_LIMIT 10000, CUBEJS_DB_QUERY_LIMIT 50000.
      • CUBEJS_DEFAULT_TIMEZONE.
      • Compiler limits: CUBEJS_COMPILER_CACHE_SIZE, CUBEJS_MAX_COMPILED_MEMBERS.
      • CUBEJS_NESTED_FOLDERS_DELIMITER, CUBEJS_SQL_INCLUDE_TRACE_ID.
      • Tesseract planner flags: CUBEJS_TESSERACT_SQL_PLANNER (default true since v1.7; setting false prints a legacy-planner deprecation warning).
    • Auth: CUBEJS_API_SECRET, CUBEJS_API_SECRETS (a rotation list), CUBEJS_JWK_URL, CUBEJS_JWT_{KEY,ALGS,AUDIENCE,ISSUER,SUBJECT,CLAIMS_NAMESPACE}.
    • SQL API:
      • CUBEJS_PG_SQL_PORT (the image defaults to 15432 in dev mode).
      • CUBEJS_SQL_USER, _PASSWORD, _SUPER_USER.
      • CUBEJS_MAX_SESSIONS (1024).
      • Pushdown and streaming: CUBESQL_SQL_PUSH_DOWN, _PUSH_DOWN_PRE_AGGREGATIONS, CUBESQL_STREAM_MODE.
      • Row limits and batching: CUBESQL_CUBE_SCAN_MAX_BATCH_ROWS (65536), CUBESQL_NON_STREAMING_QUERY_MAX_ROW_LIMIT, CUBESQL_SQL_NO_IMPLICIT_ORDER.
      • Planner limits: CUBESQL_REWRITE_*.
      • CUBESQL_AUTH_EXPIRE_SECS (300), CUBEJS_LOG_REDACTION.
    • Data sources:
      • Common connection settings: CUBEJS_DB_* (TYPE, HOST, PORT, NAME, USER, PASS, URL, SSL_*, MAX_POOL, QUERY_TIMEOUT 10m).
      • Per-driver prefixes: BQ, CLICKHOUSE, DATABRICKS, DUCKDB/MotherDuck, PRESTO, SNOWFLAKE, REDSHIFT, PINOT, Athena CUBEJS_AWS_*, FIREBOLT, JDBC.
      • Export buckets: CUBEJS_DB_EXPORT_BUCKET*.
      • Multiple sources: CUBEJS_DATASOURCES plus CUBEJS_DS_<NAME>_*.
      • Pre-aggregation-specific connections: CUBEJS_PRE_AGGREGATIONS_DB_*.
      • Bundled drivers (26): athena, bigquery, clickhouse, crate, databricks-jdbc, dremio, druid, duckdb, firebolt, hive, jdbc, ksql, materialize, mongobi, mssql, mysql, oracle, pinot, postgres, prestodb, questdb, redshift, snowflake, sqlite, trino, vertica.
    • Pre-aggregations and Cube Store:
      • CUBEJS_CUBESTORE_HOST/PORT (3030).
      • CUBEJS_PRE_AGGREGATIONS_BUILDER, CUBEJS_PRE_AGGREGATIONS_SCHEMA, CUBEJS_DROP_PRE_AGG_WITHOUT_TOUCH, CUBEJS_TOUCH_PRE_AGG_TIMEOUT.
      • CUBEJS_MAX_PARTITIONS_PER_CUBE, CUBEJS_ROLLUP_ONLY.
      • About 50 CUBESTORE_* settings (storage S3/GCS/MinIO, workers, cache, metrics), read only by the cubestored binary.
    • Refresh worker:
      • CUBEJS_REFRESH_WORKER, CUBEJS_REFRESH_WORKER_CONCURRENCY.
      • CUBEJS_SCHEDULED_REFRESH_TIMEZONES, _QUERIES_PER_APP_ID, _TIMER_INTERVAL_ONLY.
      • CUBEJS_REFRESH_KEY_LOCAL_TIME.
    • Logging and dev: CUBEJS_LOG_LEVEL, CUBEJS_TELEMETRY, CUBEJS_DEV_MODE (a full auth bypass).
    • Cloud-flavoured:
      • CUBEJS_AUTO_RUN_MODE: affects only the Cloud Explore/Workbooks UI.
      • NODE_EXTRA_CA_CERTS: documented for Semantic Layer Sync.
      • CUBEJS_DATASOURCES: auto-maintained in Cloud.
      • DAX/MDX/XMLA vars.
  • Availability: CORE (DAX/MDX vars Cloud-only). No plan tier stated.
    • CORE for about 248 of 258.
    • CLOUD-ONLY: CUBEJS_DAX_CREATE_DATE_HIERARCHIES, CUBEJS_DAX_SHARE_VARS, CUBEJS_DAX_SINGLE_PERSPECTIVE, CUBE_XMLA_LANGUAGE, CUBE_MDX_CREATE_DATE_HIERARCHIES. These names are absent from the JS, native and cubestored code, but the page doesn't say so.
    • Also absent: CUBEJS_DB_DATABRICKS_ACCEPT_POLICY (likely obsolete) and DEBUG_LOG.
    • The image reads about 80 names that are undocumented here. Examples:
      • CUBEJS_SCHEDULED_REFRESH_TIMER, CUBEJS_SCHEDULED_REFRESH_BATCH_SIZE.
      • CUBEJS_ACCESS_POLICY_MASK_{STRING,NUMBER,BOOLEAN,TIME}.
      • CUBEJS_NATIVE_API_GATEWAY_PORT, CUBEJS_PLAYGROUND_AUTH_SECRET.
      • CUBEJS_AGENT_ENDPOINT_URL and _FRAME_SIZE/_FLUSH_INTERVAL/_MAX_SOCKETS, the Cloud log shipper and not an AI agent.
      • Cloud host settings: CUBE_CLOUD_HOST, CUBEJS_LIVE_PREVIEW.
      • CUBESQL_QUERY_TIMEOUT, CUBESQL_TEMP_TABLE_*_MEM.
    • Evidence: a subagent diffed the docs names against shared/dist/src/env.js, native/index.node and cubestore/.../cubestored.
  • Core building blocks to use: these variables configure everything listed above.
  • To build on Core: a per-tenant or per-deployment env manager. Cloud "Settings → Configuration" sets these; a rebuild needs a secret store plus a deploy pipeline. S–M.
  • Gotchas:
    • The cache driver depends on NODE_ENV.
    • Redis env vars now make Cube throw.
    • Dev mode must never reach production.
    • CUBEJS_DB_SCHEMA is deprecated in favour of CUBEJS_DB_NAME.

Cube CLI (cube) — Cloud platform CLI ​

  • Docs: pages/reference/cli.md
  • What it does:
    • A single-binary cube CLI for the Cube Cloud platform. The page states it is "not required for running Cube Core locally".
    • Authentication:
      • Interactive: login --url https://TENANT.cubecloud.dev, logout, whoami, context.
      • Headless: CUBE_API_URL/CUBE_API_KEY/CUBE_AUTH_SCHEME.
    • Deployments:
      • deployments (list, get, create, update, delete, settings, versions, token, build-status). token mints a Core Data API JWT.
      • deploy <id> (hash-diff upload, --branch).
      • validate <id> (remote compile via /meta).
    • Operations: logs, query-history, regions, github.
    • data-model git workflow: branches, dev-mode, commit, merge-to-default.
    • Integrations:
      • dbt (sync, generate, status, …).
      • ossie (Apache Ossie export, import).
      • dbx-mv (Databricks Metric Views, preview).
    • evals: AI agent evals.
    • Settings: environments, variables.
    • Content: folders, workbooks (including ai-thread), reports, workspace.
    • Access: roles, users, groups, attributes, policies.
    • Administration: tenant, notifications, integrations, oidc, api-keys.
    • Other: embed, agents (list, skills), app, meta, scim, spec (OpenAPI from /api/v1/spec), api (raw request), update, completion.
  • Availability: CLOUD-ONLY. Every command targets the Cloud control-plane API. The new cube binary is not in the image.
    • The image ships the legacy, deprecated cubejs-cli 1.8.35 (/usr/local/bin/cubejs). Its commands:
      • Local, no Cloud needed: create, generate -t tables, token -e -s -p (local JWT), typegen <apiUrl>, validate -p (local compile), server.
      • Cloud: auth, and deploy via @cubejs-backend/cloud → ${CUBE_CLOUD_HOST}/v1/....
      • dev-server comes from @cubejs-backend/server (cubejs-server dev-server).
      • cubejs-cli/dist/src/deprecation.js points users to cube.
  • Core building blocks to use:
    • Legacy cubejs token for local JWTs and cubejs validate for CI model checks.
    • The Core REST API for the meta and token equivalents.
  • To build on Core: an admin CLI for your own control plane (deployments, model git, users, policies, content). Its scope tracks whatever control-plane API you build. M once that API exists.
  • Gotchas:
    • The two validate commands are different: Cloud's compiles remotely, legacy compiles locally.
    • CUBEJS_CLI_NO_DEPRECATION_WARNING silences the legacy warning.

JS SDK core client (@cubejs-client/core) ​

  • Docs: pages/reference/javascript-sdk/index.md, pages/reference/javascript-sdk/reference/cubejs-client-core.md
  • What it does:
    • cube(apiToken | async () => token, { apiUrl, headers, credentials, transport, pollInterval, parseDateMeasures, signal }) returns a CubeApi. The default transport is HttpTransport, and any ITransport can be plugged in.
    • CubeApi methods: load(query|query[], opts), sql, dryRun (returns normalizedQueries, pivotQuery, queryOrder, queryType), meta({ onlyViews }) and subscribe(query, opts, cb). The SQL API methods are cubeSql(sql, { timeout, timezone, params }), cubeSqlStream (an AsyncGenerator of schema, data and error chunks) and cubeSqlParams. Every method supports promise or callback style.
    • LoadMethodOptions: cache (one of the 4 server-side modes), castNumerics, mutexKey/mutexObj (drops orphaned older results), progressCallback, subscribe, signal (AbortController) and baseRequestId. The client polls again on Continue wait (pollInterval).
    • ResultSet methods:
      • pivot(pivotConfig) returns {xValues, yValuesArray}.
      • chartPivot returns {x, xValues, <series>}.
      • tablePivot returns flat rows.
      • tableColumns returns nested headers (dataIndex like Germany.male.Orders.count).
      • series and seriesNames.
      • drillDown({xValues,yValues}) builds a query from drillMembers.
      • decompose() splits compareDateRange and blending results.
      • Also annotation, rawData, serialize/deserialize.
    • PivotConfig is { x[], y[], fillMissingDates (default true; overrides order), fillWithValue, aliasSeries }. measures must be the last item on its axis.
    • Meta helpers: membersForQuery, resolveMember, filterOperatorsForMember, defaultTimeDimensionNameFor. Top-level helpers: defaultHeuristics, defaultOrder, movePivotItem. The Format API (@cubejs-client/core/format) has formatValue (d3-format, locale, currency), getFormat and formatDateByGranularity.
    • Numbers arrive as strings by default. castNumerics converts them, which is unsafe beyond MAX_SAFE_INTEGER.
  • Availability: CORE+CLOUD. No plan tier is stated. This is an open-source (MIT) client for Core's REST API. Every endpoint it calls exists in api-gateway/dist/src/gateway.js 1.8.35: /v1/load, /v1/subscribe, /v1/sql, /v1/dry-run, /v1/meta, /v1/cubesql, /v1/cubesql/params. As expected for a server image, @cubejs-client/* is not in the image.
  • Core building blocks to use: REST API, the data/meta/sql scopes, cache modes, and the Continue wait long-poll protocol.
  • To build on Core: nothing; install it from npm. A platform might wrap cube() with token refresh, a custom ITransport (proxy, auth, tracing via baseRequestId) and shared format and pivot utilities. S.
  • Gotchas:
    • The documented TimeDimensionGranularity type omits quarter and custom granularities, and BinaryOperator omits startsWith/endsWith.
    • fillMissingDates silently overrides order.
    • cubeSql* are HTTP-only, because the WS method schema allows only load, sql, dry-run, meta, subscribe and unsubscribe.

React bindings (@cubejs-client/react) ​

  • Docs: pages/reference/javascript-sdk/react.md, pages/reference/javascript-sdk/reference/cubejs-client-react.md
  • What it does:
    • useCubeQuery(query, { cubeApi, skip, resetResultSetOnChange, subscribe, cache, castNumerics }) returns { resultSet, isLoading, error, progress, previousQuery }.
    • CubeProvider and CubeContext provide the client; isQueryPresent is a helper.
    • <QueryRenderer query|queries loadSql cache resetResultSetOnChange updateOnlyOnStateChange render> uses render props {resultSet, error, loadingState}.
    • <QueryBuilder> is render-prop only (it renders no UI).
      • Props: query/setQuery (controlled), vizState/setVizState, defaultChartType, disableHeuristics, stateChangeHeuristics, wrapWithQueryRenderer.
      • Render props: available{Measures,Dimensions,TimeDimensions,Segments} (from /meta), the selected members, update* MemberUpdaters (add/remove/update), updateQuery, resultSet.
    • VizState is {chartType: line|bar|table|area, pivotConfig, shouldApplyHeuristicOrder}. The default heuristics add the default time dimension when a measure is picked on an empty query.
  • Availability: CORE+CLOUD. A pure client library with no plan tier.
  • Core building blocks to use: @cubejs-client/core, /v1/load, /v1/meta, /v1/sql.
  • To build on Core: nothing. A custom explorer UI can sit on QueryBuilder/useCubeQuery. S to wrap, M–L for a full explorer UI.
  • Gotchas:
    • Calling updateMeasures.remove repeatedly in a loop breaks; use updateQuery for batches.
    • QueryBuilder and QueryRenderer are class components; hooks are the modern path.

Vue bindings (@cubejs-client/vue3) ​

  • Docs: pages/reference/javascript-sdk/vue.md, pages/reference/javascript-sdk/reference/cubejs-client-vue.md
  • What it does:
    • <QueryBuilder> props: cubeApi, query (one-way reactive overwrite), initialChartType (default line), initialVizState, disableHeuristics, stateChangeHeuristics, wrapWithQueryRenderer.
    • Scoped slots: default (resultSet), empty, error (error, sqlQuery), and builder. The builder slot exposes selected and available members, per-member add*/remove*/set*/update*, chartType/updateChartType, setLimit/removeLimit, setOffset/removeOffset.
    • <QueryRenderer cubeApi query|queries loadSql> has the same slots.
    • ChartType adds number and pie, so it covers more types than React.
  • Availability: CORE+CLOUD. A client library with no plan tier.
  • Core building blocks to use: @cubejs-client/core and the REST API.
  • To build on Core: nothing. S.
  • Gotchas:
    • Only Vue 3 is documented; the Vue 2 @cubejs-client/vue package is legacy.
    • There is no composable equivalent of useCubeQuery.
    • The slot API differs from React's.

Angular bindings (@cubejs-client/ngx) ​

  • Docs: pages/reference/javascript-sdk/angular.md, pages/reference/javascript-sdk/reference/cubejs-client-ngx.md
  • What it does:
    • CubeClientModule.forRoot({ token, options }) passes the options to cube().
    • The injectable CubeClient mirrors the CubeApi methods but returns RxJS Observables.
    • watch(subject) re-runs the query on each Subject.next().
    • It provides no components and no query builder.
  • Availability: CORE+CLOUD. A client library with no plan tier.
  • Core building blocks to use: @cubejs-client/core.
  • To build on Core: nothing. Optionally add standalone or signals wrappers. S.
  • Gotchas:
    • Requires Angular 20 or later.
    • The docs show only the NgModule forRoot style and the deprecated RxJS subscribe(next, err) signature.

WebSocket transport / real-time subscriptions ​

  • Docs: pages/reference/javascript-sdk/reference/cubejs-client-ws-transport.md; the subscribe sections in cubejs-client-core.md and react.md; pages/reference/core-data-apis/rest-api/index.md#websocket-transport

  • What it does:

    • On the client, new WebSocketTransport({ apiUrl, authorization, heartBeatInterval }) is passed as transport. It queues messages until the socket opens, re-sends them on reconnect, and sends heartbeats.
    • The wire protocol is zod-validated in api-gateway/dist/src/ws/message-schema.js:
      • The first message is {authorization}.
      • Requests are {messageId, requestId?, method, params}, where method is load, sql, dry-run, meta, subscribe or unsubscribe.
      • Unsubscribe is {unsubscribe: messageId}.
    • On the server, @cubejs-backend/server WebSocketServer starts when CUBEJS_WEB_SOCKETS=true (or the webSockets option). webSocketsBasePath sets the path.
    • SubscriptionServer.processSubscriptions() re-runs every subscribed query every processSubscriptionsInterval (default 5000 ms) and pushes results that changed. LocalSubscriptionStore is in-memory.
    • Over HTTP, subscribe falls back to client polling. /v1/subscribe exists.
  • Availability: CORE. No plan tier. Verified in the image:

    • server/dist/src/websocket-server.js
    • api-gateway/dist/src/ws/{subscription-server,local-subscription-store,message-schema}.js
    • the option validators in server-core/dist/src/core/optionsValidate.js
    • CUBEJS_WEB_SOCKETS in shared/dist/src/env.js

    WS is disabled in the running container.

  • Core building blocks to use: CUBEJS_WEB_SOCKETS, processSubscriptionsInterval, webSocketsBasePath, checkAuth, contextToApiScopes.

  • To build on Core: enabling it is config only (S). Multi-replica real-time needs sticky sessions or a shared subscription store, plus change detection (e.g. on lastRefreshTime) (M–L).

  • Gotchas:

    • Subscriptions are server-side polling, so load scales with subscribers × interval.
    • SQL API methods and GraphQL can't run over WS.
    • The docs spell the option both hearBeatInterval and heartBeatInterval.

GraphQL API ​

  • Docs: pages/reference/core-data-apis/graphql-api/index.md, pages/reference/core-data-apis/graphql-api/reference.md
  • What it does:
    • The endpoint is {basePath}/graphql (express-graphql), gated by the graphql API scope. GraphiQL is available only in dev mode.
    • The schema is built per caller from the visibility-filtered meta, so it respects member-level access policies, and is cached per compilerId. If no members are visible, cube becomes no_queries_available: String!.
    • Query shape: cube(where, limit, offset, timezone, ungrouped, orderBy, cache) { <cube>(where, orderBy) { members } }. Multiple cubes per query work.
    • Type mapping:
      • Measures and dimensions are Float (number) or String (everything else).
      • Time dimensions become a TimeDimension object with value plus fixed granularity subfields: second, minute, hour, day, week, month, quarter, year. Each selected subfield becomes a timeDimension granularity.
      • inDateRange is pushed into timeDimensions.dateRange, so pre-aggregations still match.
    • Filters implemented in graphql.js:
      • Float: equals, notEquals, in, notIn, set, gt, lt, gte, lte.
      • String: the above plus contains, startsWith and endsWith and their negations.
      • DateTime: inDateRange, notInDateRange, before/afterDate, before/afterOrOnDate, set.
      • AND/OR nest.
    • Response extensions carry annotation, lastRefreshTime and usedPreAggregations.
    • The undocumented POST /v1/graphql-to-json (meta scope) converts a GraphQL query to the REST JSON format.
  • Availability: CORE. No plan tier. Verified in api-gateway/dist/src/graphql.js and the gateway route with assertApiScope('graphql'). Only "Status → API credentials → GraphQL tab" is Cloud UI.
  • Core building blocks to use: the GraphQL route, CUBEJS_DEFAULT_API_SCOPES/contextToApiScopes, access policies, pre-aggregations.
  • To build on Core: nothing for the endpoint. Filling its gaps through a custom resolver or gateway is M–L.
  • Gotchas:
    • Missing features: WS/subscriptions, segments, compareDateRange, metadata queries and custom granularities.
    • The docs mention renewQuery, but it is absent from the code; use the cache arg instead.
    • Continue wait comes back as a GraphQL error, so the client must retry.
    • Boolean dimensions are typed as String.
    • Member names pass through safeName capitalization.

MCP server (Cube connector) ​

  • Docs: pages/docs/integrations/mcp-server.md
  • What it does:
    • Hosting and auth:
      • Hosted endpoint https://cubecloud.dev/mcp, with region-specific https://<host>/api/mcp. Streamable HTTP; initialize returns an mcp-session-id; protocol version 2025-11-25.
      • OAuth Authorization Code + PKCE, scope mcp-agent-access, public client cube-mcp-client.
      • Backend apps use client_credentials with client_id=cube-api-key and secret = a Cube API key. Tokens last up to 1 h, with no refresh token.
      • RFC 8693 token-exchange lets an admin key act as a user, identified by subject_token email. This is audit-logged.
      • A token can be limited to specific tools with scope=tool:<name>.
    • Admin settings (Admin → MCP Server):
      • Default deployment.
      • Deployment allow-list, intersected with the user's role.
      • Per-tool disable list, which takes effect at the next token (≤24 h).
    • Session parameters:
      • Per call: deploymentId and agentId (null = Auto).
      • Session pins: ?agentId= or x-mcp-agent-id; ?branchName= or x-mcp-branch-name, which targets an active dev branch.
      • Every response echoes branchName.
    • Tools (each annotated read-only, write or destructive):
      • Chat: listDeployments, chat (the Analytics Chat agent, which can itself write), loadQueryResults.
      • Query: searchDataModel (similarity search over views and members), runQuery. runQuery takes SQL API SQL plus periodComparisons: up to 8 of {measure, timeDimension, offset{amount,unit}, outputs: previous|difference|percentChange}, producing columns <col>__pop_1year_previous.
      • Workbooks and dashboards: readWorkbook, createWorkbook, createReport, readReport, updateReport, deleteReport, listWorkspaceItems, moveWorkspaceItem, createFolder, renameFolder, deleteFolder, updateDashboard (draft only), publishDashboard.
      • Model files: listDataModelFiles, readDataModelFile, startDataModelEdit, writeDataModelFile, deleteDataModelFile, getDataModelChanges, getBranchDiff, getDataModelHistory, getCommitDiff, getDeploymentEnv (secrets redacted to [ENCRYPTED]).
      • Branches: getBranchState, commitDataModelChanges (confirmPublishToDefaultBranch), commitToNewBranch, mergeToDefaultBranch, discardDataModelChanges, switchUserBranch.
      • Pre-aggregations: getPreAggregationStatus, buildPreAggregation.
    • Permissions:
      • Viewer is the minimum role.
      • Model, commit and pre-aggregation tools are registered only for roles that can edit the model.
      • Queries respect RLS.
    • Interactive views: the client renders dashboards and explorations, with CSV download (≤50k rows), PNG and PDF.
  • Availability: CLOUD-ONLY (all plans). Core v1.8.35 has no MCP server and no chat or AI endpoint:
    • A word-match grep for mcp across @cubejs-backend matches only binaries: cubestored, a Databricks JDBC jar and native/index.node. The native matches are memcpy and mCp false positives; the other two weren't inspected.
    • There is no @modelcontextprotocol package.
    • No routes match chat, and there is no openai/anthropic/LLM code. The only chat hit is a Monaco editor asset in the Playground.
    • It depends on Cloud-only concepts: agents, workbooks, dashboards, dev-mode git branches, API keys and the OAuth server.
  • Core building blocks to use:
    • runQuery → /v1/cubesql, or the SQL API, under the caller's JWT.
    • searchDataModel → /v1/meta plus your own embedding index.
    • Period comparisons → run a second shifted query, or use compareDateRange on /v1/load.
    • convert-query, sql-filters.
    • Pre-aggregation tools → /v1/pre-aggregations/jobs and /cubejs-system/v1/pre-aggregations*.
    • Model tools → repositoryFactory over a git-backed store, then schemaVersion to recompile.
    • Validation → cubejs validate, or compile via /v1/meta on a dev instance.
  • To build on Core:
    • An MCP server (TypeScript MCP SDK, Streamable HTTP).
    • An OAuth 2.1 authorization server (PKCE, client credentials, token exchange), or delegate to your IdP.
    • A mapping from tokens to Cube JWTs.
    • Tool implementations over the REST and SQL APIs.
    • A vector index over meta for search.
    • Optionally, git-branch model editing with per-branch dev Cube instances.
    • Effort: M for the query/search/meta subset; L–XL with dashboards, model editing and an agent behind chat.
  • Gotchas:
    • Tool annotations are only advisory. The chat agent can write even though chat is annotated read-only.
    • Per-branch querying needs separate compiled models: contextToAppId keyed on the branch plus repositoryFactory.
    • Keep the "act as user" capability (token exchange) behind admin auth and audit logging.

Cube agent skills (Claude Code plugin & coding-agent skills) ​

  • Docs: pages/docs/integrations/agent-skills.md
  • What it does:
    • Open-source (Apache 2.0) instruction packages in cube-js/cube-agent-skills. Install in Claude Code with /plugin marketplace add cube-js/cube-agent-skills then /plugin install cube@cube, or elsewhere with npx skills add.
    • The Claude Code plugin bundles the hosted MCP server.
    • Skills:
      • cube-explore-model, cube-build-model (edits on a dev branch), cube-run-query.
      • cube-explore-content, cube-build-content (workbooks, dashboards, notifications).
      • cube-configure-agent (rules, certified queries, Agent Skills in Cube).
      • cube-admin (users, groups, policies, SCIM, OIDC), cube-embed, cube-deploy.
    • Skills use MCP when it is connected and the cube CLI (cube login --url https://TENANT.cubecloud.dev) otherwise.
    • These are distinct from "Agent Skills in Cube" (authored in the model, run in Analytics Chat).
  • Availability: CLOUD-ONLY in function, although the skill text is OSS. Every skill drives the Cloud MCP server or Cloud CLI. Nothing in Core.
  • Core building blocks to use:
    • The skill format itself, which could be forked.
    • Core REST and SQL APIs.
    • The model files on disk (a coding agent can edit YAML directly and cubejs validate).
  • To build on Core: fork the skills and repoint them at your own MCP server or CLI. For pure Core, a "model + query" skill that edits files and calls /v1/meta and /v1/cubesql is S; the content and admin skills depend on your platform's API.
  • Gotchas: the skills assume Cloud concepts (dev-mode branches, workbooks, deployments).

Slack integration (notifications & Slack Agent) ​

  • Docs: pages/docs/integrations/slack.md
  • What it does:
    • Setup: Premium and above. An admin connects via OAuth under Settings → Integrations → Slack, then picks a deployment and an agent.
    • Notifications: dashboard deliveries and alerts post screenshots to channels.
    • Slack Agent:
      • DMs to the Cube app start an Analytics Chat session, which replies in a thread. Follow-ups continue in the thread.
      • Users are matched by email, so every Slack user needs a Cube account (Viewer at least).
      • Rules can tailor Slack behaviour, e.g. an always rule to suppress charts.
    • Limits:
      • DMs only, with no channel mentions.
      • One agent at a time.
      • One-way sync: Slack chats show in the Cube UI, but messages posted in the UI don't reach Slack.
  • Availability: CLOUD-ONLY, Premium+. It needs Analytics Chat, deliveries and user management, none of which are in Core.
  • Core building blocks to use: SQL and REST APIs for answers, /v1/meta for grounding, and security context via a per-user JWT minted after email matching.
  • To build on Core:
    • A Slack app (Events API, OAuth, threads).
    • User mapping from email to your users table and JWT claims.
    • An LLM agent (tool-calling over meta and cubesql) with conversation storage.
    • A headless-browser screenshot service plus a scheduler for notifications.
    • Effort: M for the agent bot given an existing agent; L including the agent and deliveries.
  • Gotchas: email matching is a security boundary, so verify Slack emails. Charts in Slack need server-side rendering.

Cube for Google Sheets ​

  • Docs: pages/docs/integrations/google-sheets.md
  • What it does:
    • Setup:
      • Premium and above.
      • Installed from Google Workspace Marketplace; it appears as "Cube Cloud for Sheets".
      • OAuth login to the Cube account, then pick deployments.
      • Uses the SQL API internally.
    • Explorations:
      • Built from views only. default_ui_filters are pre-filled.
      • A pivot UI with Rows, Columns, Measures and Filters zones, drag and drop, and Filters and Limit & Order tabs.
      • Measure position after or before columns, with measures on rows or columns.
      • Column and row totals are computed by separate queries, so they are correct for non-additive measures. Window calcs are excluded; measure filters are dropped, dimension filters kept. A grand total comes from a third query.
      • Auto-run with debounce. A progress bar tracks large writes.
    • Saved explorations and placements:
      • Saved explorations live in the Cube workspace and can be placed multiple times, across Sheets and Excel at once.
      • The home view lists placements per sheet with last-refresh time and "Out of date" / "Not saved" states.
      • "Refresh all" runs as a tracked job (N of M, Stop). Unchanged results are not rewritten.
      • Hand-edited ranges are flagged red with a pencil icon.
      • Placements track stable sheet and spreadsheet ids but use fixed anchor cells.
      • Unauthorized placements show the owner's name only.
      • An admin "Show applied filters in reports" setting has a per-exploration override.
    • Chat pane (preview): an agent that can run and place queries, refresh or clear placements, manage sheets and folders, and confirm before destructive sheet actions. Answers are tables only. History syncs to the Cube account.
    • Report deliveries can write to Sheets on a schedule.
  • Availability: CLOUD-ONLY, Premium+. The add-on, saved explorations, workspace folders and chat are Cloud. The query engine (SQL API) is Core.
  • Core building blocks to use:
    • SQL API or /v1/cubesql for data.
    • /v1/meta filtered to type: view.
    • Folders from the meta folders/nestedFolders.
    • Separate total queries via /v1/load.
  • To build on Core:
    • A Google Apps Script or Workspace add-on (sidebar UI, OAuth to your platform, cell writes).
    • A backend for saved explorations and placements.
    • A pivot builder.
    • A token broker.
    • Effort: L (M without totals and multi-placement).
  • Gotchas:
    • Apps Script authenticates as the first signed-in Google account.
    • Anchors break when rows are inserted above them.
    • Writing large ranges is slow.

Cube for Excel ​

  • Docs: pages/docs/integrations/microsoft-excel.md
  • What it does:
    • Enterprise plan. An Office add-in from Microsoft AppSource ("Cube for Excel (add-in)") that runs on all platforms, including web, Mac and mobile.
    • It does not use native PivotTables; it has its own pivot UI. It uses the SQL API internally.
    • Features are the same as Cube for Sheets: views only, default_ui_filters, the pivot zones, measure position and order, row and column totals via separate queries, saved explorations with multi-placement across Excel and Sheets, Refresh and Refresh all, hand-edit detection, applied-filters summary, and the chat pane (preview).
    • Login is via the Cube OAuth modal.
    • (Distinct from the MDX/DAX/XMLA APIs used by native PivotTables and Power BI, which are Cloud-only and not in this slice.)
  • Availability: CLOUD-ONLY, Enterprise.
  • Core building blocks to use: SQL API, /v1/meta.
  • To build on Core: an Office.js add-in (task pane, auth via Office dialog API, range writes) sharing a backend with the Sheets add-on. L. Native PivotTable support would need an XMLA/MDX server, which is XL and absent in Core.
  • Gotchas: Office add-in distribution needs AppSource or a centralized deployment manifest.

dbt: managed pull (dbt → Cube) ​

  • Docs: pages/docs/integrations/dbt.md
  • What it does:
    • One-way import. A dbt manifest.json becomes static cube YAML: one cube per dbt model, named <prefix><model> (default dbt_, title prefix (dbt) ), written to /model/cubes/dbt by default. Output goes to a dbt-sync/… review branch, or comes back as files.
    • Manifest source:
      • Git: a Cloud sandbox clones the repo (PAT or generated SSH deploy key) and runs dbt deps and dbt parse. It uses pinned dbt Core 1.12.3 (DBT_SANDBOX_VERSION) with a generated profiles.yml, target dev by default.
      • Upload: cube dbt sync --manifest or POST /api/v1/deployments/{id}/dbt-sync, up to 50 MB.
    • Mapping:
      • sql_table is set to database.schema.alias.
      • Dimensions come from columns. The type comes from data_type, then from opt-in catalog.json, then from a name heuristic.
      • Measures: a count on every cube, plus total_<col> sums for columns whose names contain amount, price, cost, total or value.
      • Joins are many_to_one and come from relationships tests and FK constraints. Reverse joins are optional.
      • Primary keys come from, in order: PK constraints (composite allowed), unique+not_null tests, then the _id suffix.
      • meta.cube.public sets visibility.
    • Not imported: dbt metrics, semantic models and exposures. Sources, seeds and snapshots are skipped.
    • Re-pulls: files are overwritten; top-level files for removed models are deleted; subfolders are untouched.
    • Triggers: IDE dev mode, CLI/API from CI, a signed push webhook, or Analytics Chat. Notifications and history are included.
    • Warehouses: Snowflake, Redshift, Postgres, BigQuery, Databricks, Athena and ClickHouse. Default data source only.
  • Availability: CLOUD-ONLY, Premium and above.
    • Evidence: plan badge, Cloud sandbox and Platform API.
    • The image has no dbt-sync code, and the legacy cubejs-cli has no dbt command.
  • Core building blocks to use:
    • YAML model files plus cubejs validate.
    • extends as a customization layer.
    • The open-source cube_dbt package (next section) as an alternative.
  • To build on Core:
    • A CI job that parses the manifest and generates YAML with the same PK, join and measure heuristics. M.
    • Adding the Git sandbox, webhooks, review branches and UI. L.
  • Gotchas:
    • An env-dependent generate_schema_name collapses every model onto one schema unless the target is prod.
    • A cube joined without a PK breaks.
    • Each dbt project needs its own output folder and prefix, or pulls delete each other's files.

dbt in Core via cube_dbt (compile-time rendering) and legacy dbt-schema-extension ​

  • Docs: pages/docs/integrations/dbt.md (which links to the data-modeling dbt recipe)
  • What it does:
    • The OSS Python package cube_dbt reads manifest.json inside Python/Jinja models (globals.py plus .yml.jinja) and renders cubes at compile time. Its API includes Dbt.from_file(...).filter() and model.as_cube()/as_dimensions().
    • There is no sandbox and no Cloud API. Joins and measures are hand-written in Jinja.
  • Availability: CORE (OSS package). Evidence:
    • schema-compiler DataSchemaCompiler.js compiles globals.py and .jinja files.
    • The native module embeds Python.
    • But cube_dbt is not installed in cubebi-cube, and its Python 3.13 has no pip, so the image would need rebuilding.
    • The image also ships the obsolete JS @cubejs-backend/dbt-schema-extension. It supports only old dbt metrics, from a local manifest or the dbt Cloud metadata GraphQL API. Don't use it.
  • Core building blocks to use: Python/Jinja models, TemplateContext, a manifest mounted into /cube/conf.
  • To build on Core: a derived image with cube_dbt installed. S. Matching Cloud's join, PK and measure heuristics on top of it. M.
  • Gotchas: the manifest must be redeployed for changes to show up, and Jinja models compile more slowly.

dbt: push (Cube → dbt PR) ​

  • Docs: pages/docs/integrations/dbt.md
  • What it does:
    • Promotes one YAML cube that has inline sql: into the dbt repo as two files:
      • <model>.sql: a CTE projecting the dimensions, with table references to pulled models rewritten to {{ ref() }}.
      • <model>.yml: descriptions, unique/not_null tests on the PK, relationships tests from joins, and measures kept under meta.cube.measures.
    • Create-only: it never overwrites and never force-pushes.
    • It is validated with dbt deps/dbt parse in the sandbox, then opened as a PR/MR on a cube/dbt-push/* branch. Other forges get a compare link instead.
    • Needs write credentials, checked by "Verify write access". Off by default.
  • Availability: CLOUD-ONLY, preview, Premium and above.
  • Core building blocks to use: model YAML files, /v1/meta?extended for resolved SQL, and a Git or forge API.
  • To build on Core: a CLI that converts a cube to dbt files, runs dbt parse in CI and opens a PR. M.
  • Gotchas: {CUBE} and member references must be resolved to plain SQL, and you need pull metadata to know which tables can become ref().

Databricks Metric View publication (Cube → Unity Catalog) ​

  • Docs: pages/docs/integrations/databricks-metric-views.md
  • What it does:
    • One-way export. Selected YAML views from the latest successful build are compiled to Databricks Metric View YAML 1.1 and created with DDL in catalog.schema. Databricks then queries them without Cube.
    • Mapping:
      • The root cube becomes the source. sql_table must be a 3-part name, or a 2-part name plus CUBEJS_DB_DATABRICKS_CATALOG.
      • many_to_one and one_to_one joins become joins.
      • Dimensions become dimensions. Subquery dimensions become generated columns.
      • Basic aggregates become measures. Simple number multi-stage measures become calculated measures.
    • Withheld members are published without the member. Codes:
      • FANOUT_UNSAFE_METRIC
      • MULTI_STAGE_UNSUPPORTED: time_shift, rolling_window, rank, etc.
      • JOIN_NOT_REPRESENTABLE: one_to_many joins.
      • JOIN_PATH_UNSUPPORTED, SEGMENT_UNSUPPORTED, MEMBER_NOT_PUBLIC.
    • Blocking errors (about 20 CUBE_* codes) include JS views, access_policy, context variables, multiple data sources, geo/switch/sub_query dimensions, view extends and name conflicts.
    • Workflow:
      • Console steps: Settings → Data Sources → Preview (kept 7 days) → Test access (creates a temp view) → Publish. Per-view outcomes are recorded.
      • Can run syncOnDeploy.
      • Supports multiple targets with promotion, and a per-target OAuth service principal (required with driver_factory).
      • PR-check previews.
    • Ownership:
      • A registry of managed objects; takeOverTargets claims existing ones.
      • deletionPolicy is retain or delete-managed, with at most 20 drops per sync.
    • Required privileges: CAN USE on the warehouse, USE CATALOG and USE SCHEMA, SELECT, and CREATE TABLE.
    • Not transferred: Cube access policies. Unity Catalog grants apply instead.
    • Interfaces: the Platform API (/api/v1/deployments/{id}/databricks-metric-view-integrations/...) and cube dbx-mv sync --wait.
  • Availability: CLOUD-ONLY, preview, activated by support. No plan is stated.
    • No metric_view/metricView strings in the image.
    • The converter is Cloud's OSSIE-based bridge (OSSIE_CUBE_*/BRIDGE_*/DBX_* codes).
  • Core building blocks to use:
    • /v1/meta?extended (member SQL, joins, public).
    • Rendered YAML/Jinja via the compiler.
    • databricks-jdbc-driver for CREATE OR REPLACE VIEW … WITH METRICS LANGUAGE YAML.
    • CUBEJS_DB_DATABRICKS_CATALOG.
  • To build on Core:
    • A view-to-Metric-View converter with SQL reference rewriting, join-path and fan-out analysis, and a rule engine.
    • A DDL runner with an ownership registry.
    • A UI or CLI.
    • Effort: L–XL overall, or M for simple views only.
  • Gotchas:
    • Metric View joins keep at most one matched row.
    • Wrong fan-out rules give wrong numbers.
    • JS models are invisible.
    • Security-context Jinja renders only one variant.
    • Dropped views lose their Databricks grants.

Snowflake Semantic Views: pull (Snowflake → Cube) and push (Cube → Snowflake) ​

  • Docs: pages/docs/integrations/snowflake-semantic-views.md
  • What it does:
    • Pull:
      • From the Cloud IDE, browse the Semantic Views in a schema, select some (* patterns allowed) and generate cube and view YAML onto a branch or outputPath.
      • API: POST /api/v1/deployments/{id}/snowflake-semantic-view-pulls, which returns 202 with syncJobId; poll it, then fetch /result.
      • Permissions: schema-update plus SQL Runner read.
    • Push:
      • Generates CREATE SEMANTIC VIEW DDL from Cube views and runs it through the deployment's Snowflake role.
      • Mapping:
        • Cubes become logical tables. Plain-SQL cubes get a helper view CUBE_SV_SRC_<CUBE>.
        • Equi-joins to a single-column PK become relationships.
        • Dimensions become dimensions.
        • count, count_distinct, sum, avg, min and max become metrics.
      • Rejected: templated SQL (Jinja or dbt), composite PKs, non-equi joins, and calculated, filtered or rolling measures.
      • Skipped: segments, policies, hierarchies and pre-aggregations.
      • Requires the Cloud flag "Enable DDL operations in SQL" and Snowflake privileges CREATE SEMANTIC VIEW, USAGE and SELECT (plus CREATE VIEW for helper views).
      • API: .../snowflake-semantic-view-syncs.
  • Availability: CLOUD-ONLY, Enterprise, preview.
    • No semantic_view integration code in the image. The only hit is the generic sqlparser parse_semantic_view_table_factor in native.
  • Core building blocks to use: snowflake-driver (SHOW/DESCRIBE SEMANTIC VIEW, DDL), YAML model files, /v1/meta?extended, cubejs validate.
  • To build on Core: a pull script that introspects and generates YAML. M. A push converter plus DDL runner. M.
  • Gotchas:
    • Snowflake identifiers are uppercase and case-insensitive.
    • {CUBE}.col must be rewritten to the table alias.
    • Helper views have their own lifecycle to manage.
    • A pull overwrites branch files.

Apache Ossie conversion (export/import) ​

  • Docs: pages/docs/integrations/apache-ossie.md
  • What it does:
    • Converts in both directions, based on files.
    • Mapping: cube to Dataset, dimension to Field, measure to Metric, join to Relationship. With view set, the export is scoped to that view's public members.
    • Export: from the latest YAML build, or from uploaded files (up to 512 files, 20 MiB). It produces one ossie.yaml.
    • Import: an Ossie YAML file (up to 2 MiB) becomes Cube model files. dialect picks which warehouse SQL to use.
    • Round-tripping: Cube-only features (segments, pre-aggregations, hierarchies, policies) are kept in Cube extensions.
    • Issues: ERROR, WARNING or INFO, with strictFanout.
    • Limits:
      • JS models are skipped.
      • Jinja is rendered only for deployment exports.
      • Each conversion has a 60 s timeout; results are kept for 1 day.
      • Rate limits: 2 concurrent conversions and 6 per minute.
    • Interfaces:
      • IDE: Integrations → Apache Ossie.
      • CLI: cube ossie export|import, with --check for CI.
      • API: /api/v1/deployments/{id}/ossie-conversions.
  • Availability: CLOUD-ONLY, preview, support-activated, no plan stated. No ossie strings in the image. The Ossie spec itself is open (Apache).
  • Core building blocks to use: /v1/meta?extended, YAML model files, cubejs validate, the public Ossie spec.
  • To build on Core: a bidirectional converter with an extensions block and fan-out checks. M–L.
  • Gotchas:
    • Fan-out corrections can't be expressed in Ossie.
    • Context variables aren't portable.
    • extends is a hard error.
    • The spec is young.

Integrations compatibility matrix: Core API vs Cloud required ​

Pages in this slice, plus the tool classes those pages name:

IntegrationTalks toWorks against Core?Notes
Any Postgres-wire BI tool or SQL client (psql, Superset/Preset, Metabase, Tableau, Looker Studio, DBeaver, Hex/Deepnote/Jupyter via psycopg)SQL APIYesSet CUBEJS_PG_SQL_PORT. Auth uses checkSqlAuth. Preset RLS works through __user plus CUBEJS_SQL_SUPER_USER.
Front-end apps, Observable, Retool, automated jobs, community Python cube-http-clientREST /v1/load, /v1/cubesqlYesJWT signed with CUBEJS_API_SECRET or JWKS.
JS SDK (core/react/vue3/ngx/ws-transport)REST / WSYesThe WebSocket transport needs CUBEJS_WEB_SOCKETS=true.
GraphQL clients (Apollo etc.)/cubejs-api/graphqlYesCore GraphQL has fewer features than REST.
Personal Core Data API token in BI toolsSQL / RESTNo (Cloud)Rebuild it with checkAuth/checkSqlAuth plus a token store.
Power BI (DAX), native Excel PivotTables (MDX/XMLA), Kerberos/NTLMDAX/MDX APIsNo (Cloud)DAX/MDX env vars and code are absent from Core 1.8.35.
Semantic Layer Sync (push the model into Tableau, Preset, Metabase…)Cloud serviceNo (Cloud)Core accepts only a semanticLayerSync hook (optionsValidate.js:139) and never calls it. A rebuild uses /v1/meta plus each BI tool's API.
Cube for Google SheetsSQL API via the Cloud add-onNo (Cloud, Premium+)The add-on and saved explorations are Cloud; the engine is Core.
Cube for ExcelSQL API via the Cloud add-inNo (Cloud, Enterprise)Same split as Sheets.
MCP server (Claude, ChatGPT, Cursor, Copilot)Hosted cubecloud.dev/mcpNo (Cloud, all plans)Core has no MCP, chat or AI code.
Cube agent skills / Claude Code pluginCloud MCP plus cube CLINo (Cloud)The skill text is OSS and forkable.
Slack (notifications and Slack Agent)CloudNo (Cloud, Premium+)—
dbt pull and pushCloud sandbox and Platform APINo (Cloud, Premium+)cube_dbt in Python/Jinja models works in Core.
Databricks Metric Views, Snowflake Semantic Views, Apache OssieCloud Platform APINo (Cloud, preview)Converters could be built over /v1/meta?extended.
cube CLI (new)Cloud control planeNo (Cloud)The image's legacy cubejs CLI does create, generate, token, validate and typegen locally.

Core extension points ​

Every option and hook in config.md, plus the env vars a custom platform would rely on. Verified means the name was found in the Core 1.8.35 image: server-core/dist or api-gateway/dist for hooks, shared/dist/src/env.js or native/index.node for env vars.

Auth and identity

  • checkAuth(ctx, token) (verified): replace JWT checks with your own token validation (opaque personal tokens, sessions, API keys). Returns {security_context}.
  • jwt options / CUBEJS_JWK_URL, CUBEJS_JWT_KEY, _ALGS, _ISSUER, _AUDIENCE, _SUBJECT, _CLAIMS_NAMESPACE (verified): accept your IdP's JWTs directly (Auth0, Okta, Keycloak). CUBEJS_API_SECRET/CUBEJS_API_SECRETS hold HS secrets with rotation.
  • checkSqlAuth(req, user, password) (verified): map SQL API logins to platform users, per-user passwords or tokens, and security contexts. Can return superuser.
  • canSwitchSqlUser(current, new) / CUBEJS_SQL_SUPER_USER (verified): let a BI service account impersonate viewers via SET USER or __user.
  • CUBEJS_SQL_USER/CUBEJS_SQL_PASSWORD (verified): static SQL credentials when checkSqlAuth is not used.
  • extendContext(req) (verified): enrich the security context from headers or a lookup, e.g. org id or user attributes. API requests only.
  • contextToApiScopes(ctx, defaults) / CUBEJS_DEFAULT_API_SCOPES (verified): per-role endpoint access, e.g. grant jobs only to admins and meta only to builders.

Multitenancy

  • contextToAppId(ctx) (verified): one compiled model per tenant, branch or role. This is the key for COMPILE_CONTEXT.
  • repositoryFactory(ctx) (verified): serve model files from your DB or Git store per tenant or branch. This is the foundation for an in-app model IDE and dev branches.
  • schemaVersion(ctx) (verified): return the store revision or commit SHA so edits trigger a recompile.
  • contextToOrchestratorId(ctx) (verified): isolate DB pools, queues and result cache per tenant.
  • driverFactory({securityContext, dataSource}) (verified): per-tenant warehouse credentials from your secrets store, or custom driver instances. Also dialectFactory, externalDriverFactory, externalDialectFactory and contextToDataSourceId (verified, undocumented).
  • preAggregationsSchema(ctx) (verified): per-tenant pre-aggregation schema.
  • contextToCubeStoreRouterId(ctx) (verified): shard tenants across Cube Store routers.
  • contextToPreAggregationOrchestratorId(ctx) (verified): share pre-aggregation queues and caches across orchestrators, e.g. per region.
  • compilerCacheSize, maxCompiledMembers, maxCompilerCacheKeepAlive, updateCompilerCacheKeepAlive / CUBEJS_COMPILER_CACHE_SIZE, CUBEJS_MAX_COMPILED_MEMBERS (verified): bound memory with many tenants or branches.
  • CUBEJS_DATASOURCES + CUBEJS_DS_<NAME>_* (verified): static multiple data sources; this list must include every source driverFactory serves.

Security and governance

  • queryRewrite(query, ctx) (verified): custom RLS filters, query deny rules and query auditing on every REST, GraphQL and SQL request. Pushdown SQL supports only added filters.
  • Access policies (access_policy in cubes and views: row filters, member includes/excludes, masking) + contextToGroups(ctx) (verified in schema-compiler CubeEvaluator/CubeValidator and server-core CompilerApi; mask values via CUBEJS_ACCESS_POLICY_MASK_*): declarative row- and column-level security driven by groups from your IdP or platform.
  • allowUngroupedWithoutPrimaryKey / CUBEJS_ALLOW_UNGROUPED_WITHOUT_PRIMARY_KEY (verified): relax the anti-scraping guard for raw-row exports.
  • CUBEJS_DB_QUERY_DEFAULT_LIMIT / CUBEJS_DB_QUERY_LIMIT (verified): row caps.
  • CUBEJS_LOG_REDACTION (verified): redact filter values in logs.
  • CUBEJS_DEV_MODE (verified): must be false in production because it bypasses all auth.

Scheduling and pre-aggregations

  • scheduledRefreshContexts() (verified): list every tenant's security context so the refresh worker builds per-tenant pre-aggregations.
  • scheduledRefreshTimeZones / CUBEJS_SCHEDULED_REFRESH_TIMEZONES (verified): time zones to build.
  • scheduledRefreshTimer, scheduledRefreshConcurrency, scheduledRefreshBatchSize (verified) / CUBEJS_REFRESH_WORKER, CUBEJS_SCHEDULED_REFRESH_TIMER, CUBEJS_SCHEDULED_REFRESH_QUERIES_PER_APP_ID (verified): run a dedicated refresh-worker deployment.
  • orchestratorOptions / CUBEJS_CONCURRENCY, CUBEJS_DB_QUERY_TIMEOUT, CUBEJS_ROLLUP_ONLY (verified): queue tuning and rollup-only enforcement.
  • cacheAndQueueDriver / CUBEJS_CACHE_AND_QUEUE_DRIVER, CUBEJS_CUBESTORE_HOST/PORT (verified): a shared Cube Store for cache and queue in clusters.
  • REST /v1/pre-aggregations/jobs (jobs scope) and /cubejs-system/v1/pre-aggregations/* (verified routes): back-end for a pre-aggregation management UI (trigger, dry run, status, cancel).

Query APIs a platform UI would call (all verified routes)

  • /v1/load (with responseFormat, cache, total, compareDateRange), /v1/meta (+ undocumented ?extended), /v1/sql, /v1/dry-run, /v1/convert-query, /v1/sql-filters, /v1/cubesql (+ params), /v1/cubesql/params, DELETE /v1/running-query/:id, /v1/subscribe, /graphql, /v1/graphql-to-json, /readyz, /livez.
  • basePath, http.cors (verified): mount Core behind your platform gateway.
  • webSockets/CUBEJS_WEB_SOCKETS, webSocketsBasePath, processSubscriptionsInterval (verified): real-time dashboards.

SQL API

  • CUBEJS_PG_SQL_PORT (verified): enables the Postgres wire protocol.
  • CUBEJS_MAX_SESSIONS, CUBESQL_STREAM_MODE, CUBESQL_SQL_PUSH_DOWN, CUBESQL_NON_STREAMING_QUERY_MAX_ROW_LIMIT, CUBESQL_AUTH_EXPIRE_SECS, CUBESQL_TEMP_TABLE_SESSION_MEM/_TOTAL_MEM (verified in native): BI-tool connectivity, large exports, CSV-upload joins (temp tables + COPY), and re-authentication frequency.

Observability

  • logger(message, params) (verified): feed a query-history or audit store.
  • CUBEJS_AGENT_ENDPOINT_URL (+ _FRAME_SIZE, _FLUSH_INTERVAL, _MAX_SOCKETS; verified, undocumented): Core's built-in log shipper, which is how Cloud builds Query History. Point it at your own collector.
  • x-request-id/traceparent propagation (verified): correlate UI actions with queries and cancellation.
  • CUBEJS_LOG_LEVEL, CUBEJS_TELEMETRY (verified).

Dev and Playground

  • devServer, fastReload, livePreview, CUBEJS_PLAYGROUND_AUTH_SECRET (verified, mostly undocumented): Playground and live preview. Not a production surface.

Cloud-only hooks present in Core but inert

  • semanticLayerSync (verified in optionsValidate.js only; never invoked).
  • CUBE_CLOUD_HOST/CUBEJS_LIVE_PREVIEW (@cubejs-backend/cloud, used for deploy and live preview to cubecloud.dev).

MCP / AI

  • None in Core v1.8.35. I searched the code for mcp, modelcontextprotocol, chat, openai, anthropic and llm. In the JS packages and @modelcontextprotocol there were no hits. The native/index.node hits are only memcpy/mCp. The cubestored binary and the Databricks JDBC jar also matched mcp, but I didn't inspect those two. The only chat hit is a Monaco editor asset in the Playground, and the llm hits are substring false positives (e.g. collectAllMemberNames). There are no MCP, AI or LLM env vars.
  • CUBEJS_AGENT_* is a log shipper, not an AI agent.
  • A rebuilt MCP or chat layer must sit outside Core, calling /v1/meta, /v1/cubesql, /v1/load, /v1/convert-query and /v1/sql-filters with per-user JWTs.

Summary table ​

FeatureAvailabilityPlanEffort to build on CoreDepends on
Core Data APIs overview & auth matrix (incl. Personal Core Data API token, IdP auth)CORE+CLOUD (tokens/IdP/DAX/MDX Cloud)not statedS–M (personal tokens)checkAuth, checkSqlAuth, token store
Querying concepts (defaults, limits, tz, query types)CORE—noneREST/SQL APIs, env limits
REST API transport/scopes/CORS/cache/Continue waitCORE—none (S gateway)api-gateway, contextToApiScopes
REST query format & filter operatorsCORE—none/v1/load
REST endpoints (load, sql, convert-query, sql-filters, meta, cubesql, params, running-query, jobs, health) + core-data.yamlCORE—none (S–M platform layer)api-gateway routes
Metadata API (entities, model-export, data-sources, lineage)CLOUD-ONLYnot statedM/v1/meta?extended, SQL parser
SQL API setup / planning / streaming / sessionsCORE+CLOUD— (Cloud: on by default)SCUBEJS_PG_SQL_PORT, checkSqlAuth
SQL API query format & row-limit edge caseCORE—nonenative cubesql
SQL API commands & functions (temp tables, COPY, XIRR, windows)CORE—nonenative cubesql
SQL API joins (views, __cubeJoinField, multi-fact)CORE—noneviews, SQL API
SQL API auth & __user switchingCORE—ScheckSqlAuth, canSwitchSqlUser
Config: data model & multitenancy (appId, repositoryFactory, schemaVersion, compiler cache)CORE—M (model store)server-core
Config: orchestration & isolation (orchestratorId, driverFactory, router ids)CORE (multi-router Cube Store infra Cloud)—M–Ltenant registry, secrets store
Config: pre-aggregations & scheduled refreshCORE+(Cloud UI)—M (UI)refresh worker, jobs API
Config: querying hooks & security (queryRewrite, checkAuth, jwt, groups, access policies)CORE—M–L (identity/admin UI)IdP, contextToGroups, access_policy
Config: utility (logger, telemetry) & inert Cloud hooksCORE—M (query history)logger, CUBEJS_AGENT_ENDPOINT_URL
Environment variablesCORE (DAX/MDX vars Cloud-only)—S–M (env manager)shared/env.js
Cube CLI (cube)CLOUD-ONLY (legacy cubejs CLI in Core)—M (after own control-plane API)control-plane API
JS SDK core clientCORE+CLOUD—SREST API
React bindingsCORE+CLOUD—S (M–L explorer UI)@cubejs-client/core
Vue 3 bindingsCORE+CLOUD—S@cubejs-client/core
Angular bindingsCORE+CLOUD—S@cubejs-client/core
WebSocket transport / real-timeCORE—S enable; M–L multi-replicaCUBEJS_WEB_SOCKETS, SubscriptionServer
GraphQL APICORE—none (M–L for gaps)api-gateway /graphql
MCP server (Cube connector)CLOUD-ONLYAll plansM (query subset) – L/XL (full)MCP SDK, OAuth server, REST/SQL APIs, LLM agent
Cube agent skills / Claude Code pluginCLOUD-ONLYnot statedS (Core model+query skill)own MCP/CLI
Slack (notifications + Slack Agent)CLOUD-ONLYPremium+M–LSlack app, LLM agent, screenshot service, scheduler
Cube for Google Sheets (incl. chat pane)CLOUD-ONLYPremium+LWorkspace add-on, SQL API, exploration store
Cube for Excel (incl. chat pane)CLOUD-ONLYEnterpriseL (XL for native PivotTable/XMLA)Office.js add-in, SQL API
dbt managed pullCLOUD-ONLYPremium+M (generator) / L (managed)manifest parser, YAML models, CI
dbt via cube_dbt (Python/Jinja)CORE (package not installed in image)—S (+M parity)Jinja/Python models, pip in image
dbt push (Cube → dbt PR)CLOUD-ONLY (preview)Premium+MGit/forge API, dbt parse
Databricks Metric View publicationCLOUD-ONLY (preview)not statedL–XL (M simple)/v1/meta?extended, databricks driver DDL
Snowflake Semantic Views pull/pushCLOUD-ONLY (preview)EnterpriseM eachsnowflake driver, YAML models
Apache Ossie export/importCLOUD-ONLY (preview)not statedM–LOssie spec, /v1/meta?extended

Counts: 35 features. CORE 17, CORE+CLOUD 6, CLOUD-ONLY 12, UNCLEAR 0.

Pages read ​

  • pages/reference/core-data-apis/index.md
  • pages/reference/core-data-apis/queries.md
  • pages/reference/core-data-apis/rest-api/index.md
  • pages/reference/core-data-apis/rest-api/query-format.md
  • pages/reference/core-data-apis/rest-api/reference.md
  • pages/reference/core-data-apis/sql-api/index.md
  • pages/reference/core-data-apis/sql-api/query-format.md
  • pages/reference/core-data-apis/sql-api/reference.md
  • pages/reference/core-data-apis/sql-api/joins.md
  • pages/reference/core-data-apis/sql-api/security.md
  • pages/reference/core-data-apis/graphql-api/index.md
  • pages/reference/core-data-apis/graphql-api/reference.md
  • pages/reference/javascript-sdk/index.md
  • pages/reference/javascript-sdk/react.md
  • pages/reference/javascript-sdk/vue.md
  • pages/reference/javascript-sdk/angular.md
  • pages/reference/javascript-sdk/reference/cubejs-client-core.md
  • pages/reference/javascript-sdk/reference/cubejs-client-react.md
  • pages/reference/javascript-sdk/reference/cubejs-client-vue.md
  • pages/reference/javascript-sdk/reference/cubejs-client-ngx.md
  • pages/reference/javascript-sdk/reference/cubejs-client-ws-transport.md
  • pages/reference/configuration/config.md
  • pages/reference/configuration/environment-variables.md
  • pages/reference/cli.md
  • pages/docs/integrations/mcp-server.md
  • pages/docs/integrations/agent-skills.md
  • pages/docs/integrations/slack.md
  • pages/docs/integrations/google-sheets.md
  • pages/docs/integrations/microsoft-excel.md
  • pages/docs/integrations/dbt.md
  • pages/docs/integrations/databricks-metric-views.md
  • pages/docs/integrations/snowflake-semantic-views.md
  • pages/docs/integrations/apache-ossie.md
  • specs/core-data.yaml (OpenAPI: /v1/load, /v1/cubesql, /v1/meta; apiToken header with no Bearer prefix; Cloud and self-hosted server URLs. The schema fields match the Core gateway, including responseFormat, formatDescription, ___format synthetic measures, nestedFolders, usedPreAggregations and expr params.)

Note: the environment-variables, CLI, JS SDK, GraphQL, dbt, Databricks, Snowflake and Ossie pages were read in full by delegated readers working from the same brief, and their image checks were folded in here. I read everything else directly.