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-queryDELETE /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 whenCUBEJS_NATIVE_API_GATEWAYis 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.
- Four protocol families:
- 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
ntlmorDAXstrings.xmlaappears only as 2 stray matches, and the config docs only showreq.protocol === 'xmla'incheckSqlAuthexamples. - Personal tokens are validated by the "platform", meaning the Cloud control plane in front of the deployment.
- Native evidence: no
- 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/checkSqlAuthlookup, and a UI page showing connection details. S–M. - Gotchas:
checkAuthreplaces JWT verification entirely. To accept both JWTs and personal tokens, branch on token shape and call JWT verification yourself (e.g.jsonwebtokenwithCUBEJS_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_LIMITcaps non-streamed queries. - Time zone: UTC by default (
CUBEJS_DEFAULT_TIMEZONE), with a per-querytimezone.SQL_UTILShandles 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;
queryRewritecan only add filters). - compareDateRange (REST,
queryType=multi). - Total (
total: true). - Ungrouped (
ungrouped: true). It requires primary keys of all cubes unlessallowUngroupedWithoutPrimaryKeyis set.
- Troubleshooting: BI tools emitting
HAVING COUNT(1)need acountmeasure on the cube or view.
- Default order (REST/GraphQL): first time dimension with granularity ascending, otherwise first measure descending, otherwise first dimension ascending.
- Availability: CORE.
- Image evidence:
CUBESQL_SQL_NO_IMPLICIT_ORDER,CUBESQL_NON_STREAMING_QUERY_MAX_ROW_LIMITandCUBESQL_SQL_PUSH_DOWN_PRE_AGGREGATIONSare innative/index.node, andallowUngroupedWithoutPrimaryKeyis in server-core. - Only the Cloud time-zone-per-user/dashboard resolution is Cloud.
- Image evidence:
- 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
timezoneon 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) atws://host/cubejs-api/v1/ws:- The first message is
{"authorization":TOKEN}. - Then
{messageId, method, params}.
- The first message is
- Base path:
/cubejs-api(basePath)./livezand/readyzare unprefixed. - API scopes:
meta: /v1/meta, graphql-to-json, sql-filters (together withsql), cubesql/params (together withdata).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_SCOPESand, per request, bycontextToApiScopes(securityContext, defaultScopes).
- CORS:
http.cors(express-cors options), default*. - Auth: JWT in
Authorization(noBearerneeded). Dev mode skips auth. - Errors: 400 general, 403 missing/invalid token, 500 internal.
- Request IDs:
x-request-idis${spanId}-span-${seq}: 1–128 chars, charset-restricted, unpredictable. It falls back totraceparent.- An invalid ID returns 400.
- Cache control via
cacheparam:stale-if-slow(default).stale-while-revalidate.must-revalidate.no-cache.
Continue wait: a 200 with{error:"Continue wait"}aftercontinueWaitTimeout(default 10 s, max 90). The client must retry; queries not re-polled become orphaned (orphanedTimeout120 s).
- Transports: HTTP long-polling by default. WebSocket (
- Availability: CORE.
- Image evidence: the routes and
assertApiScopein gateway.js;throwContinueWait,x-request-idandtraceparenthandling in api-gateway;contextToApiScopesin server-core. - Cloud only adds "Status → API credentials" UI and request-span display in its monitoring.
- Image evidence: the routes and
- 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.
jobsscope must be explicitly granted.- A custom
x-request-idmust 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, andcube.time.granularityfor 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
nullis 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/orare nestable but cannot mix dimension and measure filters. Date filters inside anorare scoped to that branch. - timeDimensions:
{dimension, dateRange | compareDateRange, granularity}. dateRange accepts relative strings, parsed with Chrono, e.g.last quarterorfrom 7 days ago to now. OnlytimeDimensions.dateRangedrives pre-aggregation time matching; filter-based date operators do not.
- Query object:
- Availability: CORE. The spec
V1LoadRequestQueryfields match,date-parser.jsis in api-gateway, andjoinHintsandresponseFormatare 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
timeDimensionsrange and anor-scoped date filter on the same member are AND-ed. - The deprecated legacy planner doesn't validate numeric values.
- A
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/refreshKeyValuesare returned only in dev mode.
- Params:
/v1/sql: returns the generated SQL and params for REST queries (format=rest) or SQL queries (format=sql, withquery_typeregular/post_processing/pushdown).disable_post_processingis 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
sqlandmetascopes. - 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 (switchreported as string withvalues), hierarchies, segments,folders/nestedFoldersandconnectedComponent. Spec fields:format,formatDescription(d3 specifier, currency),aliasMember,granularities,drillMembers,cumulative,synthetic(<measure>___formatdynamic formats)./v1/cubesql:- Body:
{query, timezone, cache, responseFormat default|columnar, params:[{name,value,type number|string|time|boolean|expr}]}with:nameplaceholders. - Responds with NDJSON: first
schema(+lastRefreshTime,usedPreAggregations), thendatachunks of up toCUBESQL_CUBE_SCAN_MAX_BATCH_ROWSrows.
- Body:
/v1/cubesql/params: lists:nameparams with their inferred types.DELETE /v1/running-query/{requestId}: cancels in-flight queries byx-request-idacross all queues./v1/pre-aggregations/jobs(Orchestration API,jobsscope):action:postwithselector{contexts[{securityContext}], timezones, dataSources, cubes, preAggregations, dateRange, force (default true), dryRun}returns tokens.dryRunreturns partition statusesdone|outdated|missing_partition.action:getwith tokens returnsscheduled|processing|done|failure: <err>|missing_partition|not_found|pre_agg_not_found. Records are kept for 24 h.- Builds run in the receiving process.
/readyztests the default data source;/liveztests existing connections.- Also in Core but undocumented here:
/v1/dry-run,/v1/pre-aggregations/can-useand 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/dryRunare inserver-core/dist/src/core/RefreshScheduler.js. - Core building blocks to use: these are the building blocks.
/v1/sql-filtersplus/v1/cubesqlgive SQL-defined charts with interactive filters./v1/convert-querymaps an LLM-generated SQL query to a REST query./v1/pre-aggregations/jobsdrives a custom pre-aggregation management UI.running-querydrives 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/metahidespublic:falsemembers even from admins; there is noinclude_privatein Core.exprparams are raw SQL, so never pass untrusted input asexpr.usedPreAggregationsnames 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-sourcesreturns name, type, database, schema and properties, with no credentials.GET /v1/entitiesreturns a paged list of type/name/public.GET /v1/entities/{name}andPOST /v1/entities/allreturn the full entity:- title, description, meta
table_referencesandcube_referencesjoins(relationship plus join SQL; omitted under DAP)- members with
sql,is_primary_key,member_referencesandcolumn_references(lineage)
include_privaterequires themeta-privatescope, which only Control-Planetokens-for-meta-synccan mint.POST /v1/model-exportdumps everything, including DAP-hidden members, for catalogs.- Lineage for
sql:cubes is parsed from the SQL; column lineage works only forSELECT * 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-sourcesormeta-privateanywhere in@cubejs-backend1.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.jsadds to each cubesql,extends,fileNameandrefreshKey; to each member its rawsql, measurefiltersand dimensioncase; plusjoinsandpreAggregations. This is about 70% of the entity payload.- The schema-compiler evaluator, used in-process, for primary keys.
repositoryFactoryfor raw files.
- To build on Core: a service on top of
/v1/meta?extendedthat normalizes the output into the entity shape and adds a SQL parser (e.g. sqlglot) fortable_referencesandcolumn_references, plus its ownmeta-privatescope and pagination. M. - Gotchas:
- Respecting access policies in lineage needs the same
contextToGroupsand policy evaluation Core uses. - Join SQL can reveal hidden columns.
- Respecting access policies in lineage needs the same
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_PORTis set. - Credentials come from
CUBEJS_SQL_USER/CUBEJS_SQL_PASSWORD. Any database name works. - Custom auth via
checkSqlAuth,canSwitchSqlUserandCUBEJS_SQL_SUPER_USER. - Also usable over HTTP via
/v1/cubesql.
- Off in Core until
- Model mapping: each cube or view is a table, and members are columns.
information_schemaand psql\dintrospection work. - Planning: Apache DataFusion plus egg e-graph rewriting. A query is tried as regular, then post-processing, then pushdown.
- Streaming:
CUBESQL_STREAM_MODE=truestreams from the source. Streamed queries bypass Cube Store pre-aggregations. - Sessions:
CUBEJS_MAX_SESSIONScaps them. - Cache:
SET cube_cache = 'must-revalidate'etc. - Planner limits:
CUBESQL_REWRITE_MAX_NODES,_MAX_ITERATIONSand_TIMEOUThandle "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.
- On by default on port 5432 with user
- Setup:
- Availability: CORE+CLOUD.
- Core: the whole engine.
CUBESQL_STREAM_MODE,CUBEJS_MAX_SESSIONS,cube_cache,CUBESQL_REWRITE_MAX_NODESand57P01are innative/index.node. - Cloud: default enablement, credential UI, managed connection recycling with autoscaling, and Personal-token auth.
- Warning on the page:
CUBEJS_DEV_MODE=truewithoutCUBEJS_SQL_PASSWORDaccepts any credentials.
- Core: the whole engine.
- 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:avgtakes AVG;counttakes COUNT;count_distinctandcount_distinct_approxtake COUNT(DISTINCT).min/maxtake MIN/MAX;sumtakes SUM;stringtakes STRING_AGG;timetakes MAX/MIN;numbertakes 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.
- Expressions over dimensions (e.g. CASE as a grouping key) need pushdown (
- 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:vsSQL:) to check. Workarounds: explicit LIMIT, raiseCUBEJS_DB_QUERY_LIMIT, or stream mode.
- Measures: wrapped in
- 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
EXPLAINand 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 byCUBESQL_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 (includingPERCENTILE_CONT,APPROX_*), statistics, window functions (ROW_NUMBER…LEAD), andIN. - Custom functions:
XIRR. - Dialect limits:
WIDTH_BUCKETpushdown is unavailable on many dialects.SPLIT_PARTpushdown works only on Redshift, CrateDB, Cube Store, Databricks, Dremio, DuckDB, Firebolt, Materialize, Postgres and Snowflake.DATE_TRUNCtakes default granularities only.
- Commands:
- Availability: CORE.
TEMPORARY,COPY,XIRRandCUBESQL_TEMP_TABLE_SESSION_MEMare present innative/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 JOINorJOIN … ON a.__cubeJoinField = b.__cubeJoinFieldact 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.
__cubeJoinFieldis 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.passwordis absent on re-auth.
- Returns
- User switching:
CUBEJS_SQL_SUPER_USERorcanSwitchSqlUser(current, new)allow switching user.- Switching happens via
SET USERor the virtual filterWHERE __user = 'x', e.g. Preset RLS passing the viewer.
- Per-team models:
contextToAppIdcombined withCOMPILE_CONTEXTin Jinja/YAML gives per-team masked models. - Session visibility:
pg_stat_activityhides other users' query text unless the user and security context match or the user is a superuser.
- Availability: CORE.
checkSqlAuth/canSwitchSqlUserare in server-core and api-gatewaysql-server.js(superuser), and__useris 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
__userimpersonation (S). - Gotchas:
checkSqlAuthmust 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.jsorcube.py.cube.tsis no longer supported and fails at startup. Every hook can be sync or async. schemaPath: the model directory, defaultmodel(envCUBEJS_SCHEMA_PATH).contextToAppId(ctx): the key for the compiled model. Each id gets its own compile, which enablesCOMPILE_CONTEXTand a per-tenantrepositoryFactory. Called on every request. On its own it does NOT isolate cache or queues.repositoryFactory(ctx): returnsFileRepository(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 (envCUBEJS_COMPILER_CACHE_SIZE).maxCompiledMembers: bounds the cache by member count.maxCompilerCacheKeepAliveandupdateCompilerCacheKeepAlive: TTL and sliding TTL.allowJsDuplicatePropsInSchema.
- The config file is
- 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, withschemaVersiondriven 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. schemaVersionmust be cheap and stable; returning random values recompiles on every request.
- Per-tenant pre-aggregation schemas need
Configuration: query cache, queue & orchestration (multitenant isolation)
- Docs: pages/reference/configuration/config.md (Query cache & queue)
- What it does:
cacheAndQueueDriver:memoryorcubestore. Code note: the production default is triggered byNODE_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 withpreAggregationsSchemato avoid table clashes.contextToCubeStoreRouterId: routes tenants to different Cube Store routers. RequirescontextToOrchestratorId.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_DATASOURCESmust list every source it serves.- It overrides the
CUBEJS_PRE_AGGREGATIONS_*connection.
- Returns
orchestratorOptions:continueWaitTimeout: 10 s, max 90.rollupOnlyMode.queryCacheOptions:refreshKeyRenewalThreshold,backgroundRenew,queueOptions.preAggregationsOptions:maxPartitions10000,queueOptions,externalRefresh.- Queue options:
concurrency,executionTimeout600,orphanedTimeout120,heartBeatInterval30. - The docs discourage these and point to
CUBEJS_ROLLUP_ONLY,CUBEJS_DB_QUERY_TIMEOUTandCUBEJS_CONCURRENCYinstead.
- Availability: CORE. All present in server-core;
detectQueueAndCacheDriveris inquery-orchestrator/dist/src/orchestrator/QueryOrchestrator.js.- The Cloud part is "Multi-router Cube Store" and multi-cluster infrastructure, which is what makes
contextToCubeStoreRouterIduseful.
- The Cloud part is "Multi-router Cube Store" and multi-cluster infrastructure, which is what makes
- 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
driverFactoryconnection 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.
- If one
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.
- A string or
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_ONLYmakes 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,ConcurrencyandBatchSizeare all in server-core.- Cloud adds the managed refresh worker, the Pre-Aggregations UI and shared Cube Store.
- Core building blocks to use:
scheduledRefreshContextsfed 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.
extendContextis 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 whenCUBESQL_SQL_PUSH_DOWNis 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 definecontextToAppIdso 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 theCUBEJS_JWK_URL/CUBEJS_JWT_*env vars.checkSqlAuth(req, user, password):req.protocolandreq.methodidentify 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_policyin the model, row and member level) are implemented inschema-compiler(CubeEvaluator.js,CubeValidator.js,ViewCompilationGate.js) andserver-core/dist/src/core/CompilerApi.js. The mask env varsCUBEJS_ACCESS_POLICY_MASK_*are inshared/env.js. - Cloud adds UI-managed groups, user attributes and SSO that populate the security context.
- Access policies (
- Core building blocks to use: this is the security core: JWT/JWKS from your IdP, then
contextToGroups, thenaccess_policy, plusqueryRewritefor 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.
queryRewriteerrors 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_REDACTIONis 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,externalDialectFactoryqueryTransformer(the legacy name of queryRewrite)contextToDataSourceIddevServer,fastReload,livePreview,sqlCachesemanticLayerSync:joi.func()inserver-core/dist/src/core/optionsValidate.js:139, accepted but never called in Core.
- Availability: CORE for
loggerandtelemetry.semanticLayerSyncis 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
loggerhook orCUBEJS_AGENT_ENDPOINT_URLpointed 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(defaultmeta,data,graphql,sql;jobsexcluded).- Query limits:
CUBEJS_DB_QUERY_DEFAULT_LIMIT10000,CUBEJS_DB_QUERY_LIMIT50000. 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_DATASOURCESplusCUBEJS_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.
- Common connection settings:
- 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 thecubestoredbinary.
- 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.
- Server and API:
- 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) andDEBUG_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_URLand_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.nodeandcubestore/.../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_SCHEMAis deprecated in favour ofCUBEJS_DB_NAME.
- The cache driver depends on
Cube CLI (cube) — Cloud platform CLI
- Docs: pages/reference/cli.md
- What it does:
- A single-binary
cubeCLI 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.
- Interactive:
- Deployments:
deployments(list, get, create, update, delete, settings, versions, token, build-status).tokenmints a Core Data API JWT.deploy <id>(hash-diff upload,--branch).validate <id>(remote compile via/meta).
- Operations:
logs,query-history,regions,github. data-modelgit 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(includingai-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.
- A single-binary
- Availability: CLOUD-ONLY. Every command targets the Cloud control-plane API. The new
cubebinary is not in the image.- The image ships the legacy, deprecated
cubejs-cli1.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, anddeployvia@cubejs-backend/cloud→${CUBE_CLOUD_HOST}/v1/.... dev-servercomes from@cubejs-backend/server(cubejs-server dev-server).cubejs-cli/dist/src/deprecation.jspoints users tocube.
- Local, no Cloud needed:
- The image ships the legacy, deprecated
- Core building blocks to use:
- Legacy
cubejs tokenfor local JWTs andcubejs validatefor CI model checks. - The Core REST API for the
metaandtokenequivalents.
- Legacy
- 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
validatecommands are different: Cloud's compiles remotely, legacy compiles locally. CUBEJS_CLI_NO_DEPRECATION_WARNINGsilences the legacy warning.
- The two
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 aCubeApi. The default transport isHttpTransport, and anyITransportcan be plugged in.CubeApimethods:load(query|query[], opts),sql,dryRun(returnsnormalizedQueries,pivotQuery,queryOrder,queryType),meta({ onlyViews })andsubscribe(query, opts, cb). The SQL API methods arecubeSql(sql, { timeout, timezone, params }),cubeSqlStream(an AsyncGenerator of schema, data and error chunks) andcubeSqlParams. 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) andbaseRequestId. The client polls again onContinue wait(pollInterval).ResultSetmethods:pivot(pivotConfig)returns{xValues, yValuesArray}.chartPivotreturns{x, xValues, <series>}.tablePivotreturns flat rows.tableColumnsreturns nested headers (dataIndexlikeGermany.male.Orders.count).seriesandseriesNames.drillDown({xValues,yValues})builds a query fromdrillMembers.decompose()splits compareDateRange and blending results.- Also
annotation,rawData,serialize/deserialize.
PivotConfigis{ x[], y[], fillMissingDates (default true; overrides order), fillWithValue, aliasSeries }.measuresmust be the last item on its axis.Metahelpers:membersForQuery,resolveMember,filterOperatorsForMember,defaultTimeDimensionNameFor. Top-level helpers:defaultHeuristics,defaultOrder,movePivotItem. The Format API (@cubejs-client/core/format) hasformatValue(d3-format, locale, currency),getFormatandformatDateByGranularity.- Numbers arrive as strings by default.
castNumericsconverts them, which is unsafe beyondMAX_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.js1.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/sqlscopes, cache modes, and theContinue waitlong-poll protocol. - To build on Core: nothing; install it from npm. A platform might wrap
cube()with token refresh, a customITransport(proxy, auth, tracing viabaseRequestId) and shared format and pivot utilities. S. - Gotchas:
- The documented
TimeDimensionGranularitytype omitsquarterand custom granularities, andBinaryOperatoromits startsWith/endsWith. fillMissingDatessilently overridesorder.cubeSql*are HTTP-only, because the WS method schema allows only load, sql, dry-run, meta, subscribe and unsubscribe.
- The documented
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 }.CubeProviderandCubeContextprovide the client;isQueryPresentis 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.
- Props:
VizStateis{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.removerepeatedly in a loop breaks; useupdateQueryfor batches. - QueryBuilder and QueryRenderer are class components; hooks are the modern path.
- Calling
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), andbuilder. Thebuilderslot exposes selected and available members, per-memberadd*/remove*/set*/update*,chartType/updateChartType,setLimit/removeLimit,setOffset/removeOffset. <QueryRenderer cubeApi query|queries loadSql>has the same slots.ChartTypeaddsnumberandpie, so it covers more types than React.
- Availability: CORE+CLOUD. A client library with no plan tier.
- Core building blocks to use:
@cubejs-client/coreand the REST API. - To build on Core: nothing. S.
- Gotchas:
- Only Vue 3 is documented; the Vue 2
@cubejs-client/vuepackage is legacy. - There is no composable equivalent of
useCubeQuery. - The slot API differs from React's.
- Only Vue 3 is documented; the Vue 2
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 tocube().- The injectable
CubeClientmirrors theCubeApimethods but returns RxJS Observables. watch(subject)re-runs the query on eachSubject.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
forRootstyle and the deprecated RxJSsubscribe(next, err)signature.
WebSocket transport / real-time subscriptions
Docs: pages/reference/javascript-sdk/reference/cubejs-client-ws-transport.md; the
subscribesections in cubejs-client-core.md and react.md; pages/reference/core-data-apis/rest-api/index.md#websocket-transportWhat it does:
- On the client,
new WebSocketTransport({ apiUrl, authorization, heartBeatInterval })is passed astransport. 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}, wheremethodis load, sql, dry-run, meta, subscribe or unsubscribe. - Unsubscribe is
{unsubscribe: messageId}.
- The first message is
- On the server,
@cubejs-backend/serverWebSocketServerstarts whenCUBEJS_WEB_SOCKETS=true(or thewebSocketsoption).webSocketsBasePathsets the path. SubscriptionServer.processSubscriptions()re-runs every subscribed query everyprocessSubscriptionsInterval(default 5000 ms) and pushes results that changed.LocalSubscriptionStoreis in-memory.- Over HTTP,
subscribefalls back to client polling./v1/subscribeexists.
- On the client,
Availability: CORE. No plan tier. Verified in the image:
server/dist/src/websocket-server.jsapi-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_SOCKETSinshared/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
hearBeatIntervalandheartBeatInterval.
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 thegraphqlAPI 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,
cubebecomesno_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
TimeDimensionobject withvalueplus fixed granularity subfields: second, minute, hour, day, week, month, quarter, year. Each selected subfield becomes a timeDimension granularity. inDateRangeis pushed intotimeDimensions.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/ORnest.
- Response
extensionscarryannotation,lastRefreshTimeandusedPreAggregations. - The undocumented
POST /v1/graphql-to-json(metascope) converts a GraphQL query to the REST JSON format.
- The endpoint is
- Availability: CORE. No plan tier. Verified in
api-gateway/dist/src/graphql.jsand the gateway route withassertApiScope('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 thecachearg instead. Continue waitcomes back as a GraphQL error, so the client must retry.- Boolean dimensions are typed as String.
- Member names pass through
safeNamecapitalization.
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-specifichttps://<host>/api/mcp. Streamable HTTP;initializereturns anmcp-session-id; protocol version 2025-11-25. - OAuth Authorization Code + PKCE, scope
mcp-agent-access, public clientcube-mcp-client. - Backend apps use
client_credentialswithclient_id=cube-api-keyand 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_tokenemail. This is audit-logged. - A token can be limited to specific tools with
scope=tool:<name>.
- Hosted endpoint
- 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:
deploymentIdandagentId(null= Auto). - Session pins:
?agentId=orx-mcp-agent-id;?branchName=orx-mcp-branch-name, which targets an active dev branch. - Every response echoes
branchName.
- Per call:
- 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.runQuerytakes SQL API SQL plusperiodComparisons: 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.
- Chat:
- 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.
- Hosting and auth:
- Availability: CLOUD-ONLY (all plans). Core v1.8.35 has no MCP server and no chat or AI endpoint:
- A word-match grep for
mcpacross@cubejs-backendmatches only binaries:cubestored, a Databricks JDBC jar andnative/index.node. Thenativematches arememcpyandmCpfalse positives; the other two weren't inspected. - There is no
@modelcontextprotocolpackage. - No routes match
chat, and there is no openai/anthropic/LLM code. The onlychathit 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.
- A word-match grep for
- Core building blocks to use:
runQuery→/v1/cubesql, or the SQL API, under the caller's JWT.searchDataModel→/v1/metaplus your own embedding index.- Period comparisons → run a second shifted query, or use
compareDateRangeon/v1/load. convert-query,sql-filters.- Pre-aggregation tools →
/v1/pre-aggregations/jobsand/cubejs-system/v1/pre-aggregations*. - Model tools →
repositoryFactoryover a git-backed store, thenschemaVersionto recompile. - Validation →
cubejs validate, or compile via/v1/metaon 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
chatagent can write even thoughchatis annotated read-only. - Per-branch querying needs separate compiled models:
contextToAppIdkeyed on the branch plusrepositoryFactory. - Keep the "act as user" capability (token exchange) behind admin auth and audit logging.
- Tool annotations are only advisory. The
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-skillsthen/plugin install cube@cube, or elsewhere withnpx 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
cubeCLI (cube login --url https://TENANT.cubecloud.dev) otherwise. - These are distinct from "Agent Skills in Cube" (authored in the model, run in Analytics Chat).
- Open-source (Apache 2.0) instruction packages in
- 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/metaand/v1/cubesqlis 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
alwaysrule 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/metafor 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_filtersare 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.
- Built from views only.
- 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.
- Setup:
- 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/cubesqlfor data. /v1/metafiltered totype: view.- Folders from the meta
folders/nestedFolders. - Separate total queries via
/v1/load.
- SQL API or
- 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.jsonbecomes static cube YAML: one cube per dbt model, named<prefix><model>(defaultdbt_, title prefix(dbt)), written to/model/cubes/dbtby default. Output goes to adbt-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 depsanddbt parse. It uses pinned dbt Core 1.12.3 (DBT_SANDBOX_VERSION) with a generatedprofiles.yml, targetdevby default. - Upload:
cube dbt sync --manifestorPOST /api/v1/deployments/{id}/dbt-sync, up to 50 MB.
- Git: a Cloud sandbox clones the repo (PAT or generated SSH deploy key) and runs
- Mapping:
sql_tableis set todatabase.schema.alias.- Dimensions come from columns. The type comes from
data_type, then from opt-incatalog.json, then from a name heuristic. - Measures: a
counton every cube, plustotal_<col>sums for columns whose names contain amount, price, cost, total or value. - Joins are
many_to_oneand come fromrelationshipstests and FK constraints. Reverse joins are optional. - Primary keys come from, in order: PK constraints (composite allowed),
unique+not_nulltests, then the_idsuffix. meta.cube.publicsets 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.
- One-way import. A dbt
- Availability: CLOUD-ONLY, Premium and above.
- Evidence: plan badge, Cloud sandbox and Platform API.
- The image has no
dbt-synccode, and the legacycubejs-clihas nodbtcommand.
- Core building blocks to use:
- YAML model files plus
cubejs validate. extendsas a customization layer.- The open-source
cube_dbtpackage (next section) as an alternative.
- YAML model files plus
- 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_namecollapses 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.
- An env-dependent
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_dbtreadsmanifest.jsoninside Python/Jinja models (globals.pyplus.yml.jinja) and renders cubes at compile time. Its API includesDbt.from_file(...).filter()andmodel.as_cube()/as_dimensions(). - There is no sandbox and no Cloud API. Joins and measures are hand-written in Jinja.
- The OSS Python package
- Availability: CORE (OSS package). Evidence:
schema-compilerDataSchemaCompiler.jscompilesglobals.pyand.jinjafiles.- The native module embeds Python.
- But
cube_dbtis not installed incubebi-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_dbtinstalled. 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_nulltests on the PK,relationshipstests from joins, and measures kept undermeta.cube.measures.
- Create-only: it never overwrites and never force-pushes.
- It is validated with
dbt deps/dbt parsein the sandbox, then opened as a PR/MR on acube/dbt-push/*branch. Other forges get a compare link instead. - Needs write credentials, checked by "Verify write access". Off by default.
- Promotes one YAML cube that has inline
- Availability: CLOUD-ONLY, preview, Premium and above.
- Core building blocks to use: model YAML files,
/v1/meta?extendedfor resolved SQL, and a Git or forge API. - To build on Core: a CLI that converts a cube to dbt files, runs
dbt parsein 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 becomeref().
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_tablemust be a 3-part name, or a 2-part name plusCUBEJS_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
numbermulti-stage measures become calculated measures.
- The root cube becomes the
- Withheld members are published without the member. Codes:
FANOUT_UNSAFE_METRICMULTI_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, viewextendsand 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;
takeOverTargetsclaims existing ones. deletionPolicyis retain or delete-managed, with at most 20 drops per sync.
- A registry of managed objects;
- 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/...) andcube dbx-mv sync --wait.
- 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
- Availability: CLOUD-ONLY, preview, activated by support. No plan is stated.
- No
metric_view/metricViewstrings in the image. - The converter is Cloud's OSSIE-based bridge (
OSSIE_CUBE_*/BRIDGE_*/DBX_*codes).
- No
- Core building blocks to use:
/v1/meta?extended(member SQL, joins,public).- Rendered YAML/Jinja via the compiler.
databricks-jdbc-driverforCREATE 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 oroutputPath. - API:
POST /api/v1/deployments/{id}/snowflake-semantic-view-pulls, which returns 202 withsyncJobId; poll it, then fetch/result. - Permissions: schema-update plus SQL Runner read.
- From the Cloud IDE, browse the Semantic Views in a schema, select some (
- Push:
- Generates
CREATE SEMANTIC VIEWDDL 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.
- Cubes become logical tables. Plain-SQL cubes get a helper view
- 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 (plusCREATE VIEWfor helper views). - API:
.../snowflake-semantic-view-syncs.
- Generates
- Pull:
- Availability: CLOUD-ONLY, Enterprise, preview.
- No
semantic_viewintegration code in the image. The only hit is the generic sqlparserparse_semantic_view_table_factorin native.
- No
- 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}.colmust 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
viewset, 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.
dialectpicks 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--checkfor CI. - API:
/api/v1/deployments/{id}/ossie-conversions.
- Availability: CLOUD-ONLY, preview, support-activated, no plan stated. No
ossiestrings 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.
extendsis 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:
| Integration | Talks to | Works 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 API | Yes | Set 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-client | REST /v1/load, /v1/cubesql | Yes | JWT signed with CUBEJS_API_SECRET or JWKS. |
| JS SDK (core/react/vue3/ngx/ws-transport) | REST / WS | Yes | The WebSocket transport needs CUBEJS_WEB_SOCKETS=true. |
| GraphQL clients (Apollo etc.) | /cubejs-api/graphql | Yes | Core GraphQL has fewer features than REST. |
| Personal Core Data API token in BI tools | SQL / REST | No (Cloud) | Rebuild it with checkAuth/checkSqlAuth plus a token store. |
| Power BI (DAX), native Excel PivotTables (MDX/XMLA), Kerberos/NTLM | DAX/MDX APIs | No (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 service | No (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 Sheets | SQL API via the Cloud add-on | No (Cloud, Premium+) | The add-on and saved explorations are Cloud; the engine is Core. |
| Cube for Excel | SQL API via the Cloud add-in | No (Cloud, Enterprise) | Same split as Sheets. |
| MCP server (Claude, ChatGPT, Cursor, Copilot) | Hosted cubecloud.dev/mcp | No (Cloud, all plans) | Core has no MCP, chat or AI code. |
| Cube agent skills / Claude Code plugin | Cloud MCP plus cube CLI | No (Cloud) | The skill text is OSS and forkable. |
| Slack (notifications and Slack Agent) | Cloud | No (Cloud, Premium+) | — |
| dbt pull and push | Cloud sandbox and Platform API | No (Cloud, Premium+) | cube_dbt in Python/Jinja models works in Core. |
| Databricks Metric Views, Snowflake Semantic Views, Apache Ossie | Cloud Platform API | No (Cloud, preview) | Converters could be built over /v1/meta?extended. |
cube CLI (new) | Cloud control plane | No (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}.jwtoptions /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_SECRETShold 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 returnsuperuser.canSwitchSqlUser(current, new)/CUBEJS_SQL_SUPER_USER(verified): let a BI service account impersonate viewers viaSET USERor__user.CUBEJS_SQL_USER/CUBEJS_SQL_PASSWORD(verified): static SQL credentials whencheckSqlAuthis 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. grantjobsonly to admins andmetaonly to builders.
Multitenancy
contextToAppId(ctx)(verified): one compiled model per tenant, branch or role. This is the key forCOMPILE_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. AlsodialectFactory,externalDriverFactory,externalDialectFactoryandcontextToDataSourceId(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 sourcedriverFactoryserves.
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_policyin cubes and views: row filters, member includes/excludes, masking) +contextToGroups(ctx)(verified in schema-compilerCubeEvaluator/CubeValidatorand server-coreCompilerApi; mask values viaCUBEJS_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(jobsscope) 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(withresponseFormat,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/traceparentpropagation (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 inoptionsValidate.jsonly; 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,anthropicandllm. In the JS packages and@modelcontextprotocolthere were no hits. Thenative/index.nodehits are onlymemcpy/mCp. Thecubestoredbinary and the Databricks JDBC jar also matchedmcp, but I didn't inspect those two. The onlychathit is a Monaco editor asset in the Playground, and thellmhits 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-queryand/v1/sql-filterswith per-user JWTs.
Summary table
| Feature | Availability | Plan | Effort to build on Core | Depends on |
|---|---|---|---|---|
| Core Data APIs overview & auth matrix (incl. Personal Core Data API token, IdP auth) | CORE+CLOUD (tokens/IdP/DAX/MDX Cloud) | not stated | S–M (personal tokens) | checkAuth, checkSqlAuth, token store |
| Querying concepts (defaults, limits, tz, query types) | CORE | — | none | REST/SQL APIs, env limits |
| REST API transport/scopes/CORS/cache/Continue wait | CORE | — | none (S gateway) | api-gateway, contextToApiScopes |
| REST query format & filter operators | CORE | — | none | /v1/load |
| REST endpoints (load, sql, convert-query, sql-filters, meta, cubesql, params, running-query, jobs, health) + core-data.yaml | CORE | — | none (S–M platform layer) | api-gateway routes |
| Metadata API (entities, model-export, data-sources, lineage) | CLOUD-ONLY | not stated | M | /v1/meta?extended, SQL parser |
| SQL API setup / planning / streaming / sessions | CORE+CLOUD | — (Cloud: on by default) | S | CUBEJS_PG_SQL_PORT, checkSqlAuth |
| SQL API query format & row-limit edge case | CORE | — | none | native cubesql |
| SQL API commands & functions (temp tables, COPY, XIRR, windows) | CORE | — | none | native cubesql |
| SQL API joins (views, __cubeJoinField, multi-fact) | CORE | — | none | views, SQL API |
| SQL API auth & __user switching | CORE | — | S | checkSqlAuth, 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–L | tenant registry, secrets store |
| Config: pre-aggregations & scheduled refresh | CORE+(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 hooks | CORE | — | M (query history) | logger, CUBEJS_AGENT_ENDPOINT_URL |
| Environment variables | CORE (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 client | CORE+CLOUD | — | S | REST API |
| React bindings | CORE+CLOUD | — | S (M–L explorer UI) | @cubejs-client/core |
| Vue 3 bindings | CORE+CLOUD | — | S | @cubejs-client/core |
| Angular bindings | CORE+CLOUD | — | S | @cubejs-client/core |
| WebSocket transport / real-time | CORE | — | S enable; M–L multi-replica | CUBEJS_WEB_SOCKETS, SubscriptionServer |
| GraphQL API | CORE | — | none (M–L for gaps) | api-gateway /graphql |
| MCP server (Cube connector) | CLOUD-ONLY | All plans | M (query subset) – L/XL (full) | MCP SDK, OAuth server, REST/SQL APIs, LLM agent |
| Cube agent skills / Claude Code plugin | CLOUD-ONLY | not stated | S (Core model+query skill) | own MCP/CLI |
| Slack (notifications + Slack Agent) | CLOUD-ONLY | Premium+ | M–L | Slack app, LLM agent, screenshot service, scheduler |
| Cube for Google Sheets (incl. chat pane) | CLOUD-ONLY | Premium+ | L | Workspace add-on, SQL API, exploration store |
| Cube for Excel (incl. chat pane) | CLOUD-ONLY | Enterprise | L (XL for native PivotTable/XMLA) | Office.js add-in, SQL API |
| dbt managed pull | CLOUD-ONLY | Premium+ | 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+ | M | Git/forge API, dbt parse |
| Databricks Metric View publication | CLOUD-ONLY (preview) | not stated | L–XL (M simple) | /v1/meta?extended, databricks driver DDL |
| Snowflake Semantic Views pull/push | CLOUD-ONLY (preview) | Enterprise | M each | snowflake driver, YAML models |
| Apache Ossie export/import | CLOUD-ONLY (preview) | not stated | M–L | Ossie 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;apiTokenheader with noBearerprefix; Cloud and self-hosted server URLs. The schema fields match the Core gateway, includingresponseFormat,formatDescription,___formatsynthetic measures,nestedFolders,usedPreAggregationsandexprparams.)
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.