Connect from Cube Cloud
Navigate to the Integrations page, click Connect to Cube, and choose Observable to get detailed instructions.Connect from Cube Core
You can connect a Cube deployment to Observable using the SQL API or the REST (JSON) API. In Cube Core, the SQL API is disabled by default. Enable it and configure the credentials to connect to Observable.Connecting from Observable
Connecting via SQL API
Observable connects to Cube as to a Postgres database.Querying data with SQL API
Your cubes will be exposed as tables, where both your measures and dimensions are columns. Make sure to add a database to your notebook, and select Database query when adding a new block. You can write SQL in Observable that will be executed in Cube. Learn more about Cube SQL syntax on the reference page. You can also create a visualization of the executed SQL query.Connecting via REST (JSON) API
For a Cube instance publicly available at a specificHOST, the REST (JSON) API URL
would be HOST/cubejs-api/v1. Please refer to the
REST (JSON) API page for details.
You will also need to generate a JSON Web Token that would be used to
authenticate requests to Cube.
Please check the Security page
to learn how to generate a token. We suggest generating a long-lived JWT that
won’t expire soon.
Querying data with REST (JSON) API
First, add two generic JavaScript cells: Next, copy Cube’s REST (JSON) API URL and the Authorization token and paste them into their respective cells.HOST/cubejs-api/v1, don’t forget
to add the /load endpoint to the end of the data source API.
jsonBody for simplicity. Make sure to add a query parameter
for your JSON query.
jsonBody object inside the
JSON.stringify call.