Appsmith
Appsmith (opens in a new tab) is an open-source framework for building internal tools. You can connect a Cube deployment to Appsmith using Cube’s REST API.
Here's a short video guide on how to connect Appsmith to Cube.
Use REST API in Cube
Don't have a Cube project yet? Learn how to get started here.
Cube Cloud
Click the “How to connect” link on the Overview page, navigate to the REST API tab. You should see the screen below with your connection credentials (the REST API URL and the authorization token):
Self-hosted Cube
For a Cube instance publicly available at a specific HOST
, the REST API URL
would be HOST/cubejs-api/v1
. Please refer to the
REST 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.
Create a new Data Source in Appsmith
Copy and paste the REST API URL and the Authorization token to create a new data source in Appsmith.
Create a POST request in Appsmith
Get your Cube query in the JSON query format ready. You can copy it from Cube’s Playground or compose manually:
Create a POST request, paste the JSON query in the Body. Make sure to add a
query
parameter for your JSON query.
Because you saved the data source as HOST/cubejs-api/v1
, don't forget to add a
/load
endpoint to the end of the data source API.
Next, hit Run.
Display the Data in Appsmith
You have many options to display the data in Appsmith. For instance, you can display the data in a table widget. Also, you can create a chart widget and map the values to x and y coordinates accordingly, give a title and names to the axis.