Build your first Embeddable
Create and deploy your first Embeddable dashboard.
An Embeddable is an interactive dashboard that you embed in your web application.
Create a New Embeddable
On your workspace homepage, click Create new Embeddable to create a fresh dashboard.
Add a Dataset
Datasets are how you access data on a dashboard.
Your workspace is linked to our sample database.
- In the Datasets Panel in the bottom right, click the + icon.
- Name your dataset.
- Select My customers (or any other sample data model), then Save.
Add a Donut Chart
Build your dashboard by adding components to the canvas.
- Click Add component. Pick Donut Chart.
- In the edit panel, set Dataset to display to the dataset you just created.
- Select your preferred Measure and Dimension.
- Hit Save.
Bonus: check the console in the right sidebar to see what's happening behind the scenes.
Add Interactivity
Adding interactivity is quick and easy.
- Click Add component, choose Date Range Select Field, then hit Save.
In the right-hand Variables panel in the Builder, you’ll see a new variable appear: date-range value. Variables store outputs from interactive components (like date pickers) and can be passed around the dashboard.
- Edit your Donut Chart.
- Click Filter (under the Dataset input) and, from the dropdown, choose the Signed up at Dimension.
- Next to the filter operator (“In date range”), click the link icon.
- Select the date-range value variable, then hit Save.
Success! Switch to Preview mode in the top bar to test the interaction.
Embed your dashboard
As a final step, embed your dashboard using the embedding-preview script.
Save a version
- Click 'Save version' at the top of your dashboard.
- Enter a simple description and click 'Save new version'.
Publish the dashboard
- Click the 'Publish' button in the top bar.
- Select the 'Production' environment (the green box).
- Grab your API Key and Embeddable ID from the 'How to embed' section at the bottom of the modal.
- Click 'Publish' to publish your saved version.
Test embedding
-
Head to your code repo, open
embedding-preview.cjs(here (opens in a new tab)). -
Update the
BASE_URL,API_KEY, andEMBEDDABLE_IDwith the values from your dashboard. Then run:node src/embeddable.com/scripts/embedding-preview.cjs -
Go to http://localhost:8080/ (opens in a new tab) to see your embedded dashboard in action! 🤩
Congratulations! You've built your first Embeddable - now you're well on your way to creating amazing, interactive analytics experiences.