Skip to content

Connect Cube ​

Decision Layer reads metrics and dimensions and queries data through Cube's REST API. Cube owns metric definitions and joins.

Start your project ​

In the environment where you installed Decision Layer, create and start a team project. If the demo is running, stop it with Ctrl+C first.

bash
decision-layer init my_team
cd my_team
decision-layer serve

Enter the connection ​

Open Sources in the admin console.

  1. Enter the Cube API URL and authentication method.
  2. Test the connection and save it.
  3. Check that the required metrics and dimensions appear in Metrics.
Cube locationExample API URL
Same computerhttp://127.0.0.1:4000/cubejs-api/v1
Remote serverhttps://your-cube.example/cubejs-api/v1
Decision Layer runs inside Dockerhttp://host.docker.internal:4000/cubejs-api/v1

The address must be reachable from the Decision Layer server. Inside a container, localhost refers to that container.

Authentication ​

For an existing deployment, use a user token issued by that Cube environment. API-secret authentication and sample credentials are for local testing.

Saved credentials are encrypted; environment settings take precedence. See .env.example for connection administration settings.

Troubleshoot ​

SymptomCheck
Unreachable/cubejs-api/v1 in the URL, port and network
401 or 403Token expiry and access scope
No metricsDeployed Cube models and the user's model access
Missing date or variableWhether Cube defines the required object

Continue with Recipes or AI tools.