Reference applications for common web frameworks showing how to embed Metabase charts
This repo contains example applications for common web frameworks to demonstrate how Metabase dashboards can be embedded in your application using the static embedding feature.
For interactive embedding, check out the following resources:
If you are unsure about what embedding feature is best for you, check out our live demos.
This README will walk you through getting Metabase up and running, as well as a simple web app, to show you a live example of an embedded dashboard.
Here’s a simple Metabase dashboard in action:
Embedding Metabase charts will always be free, but we include a “Powered by Metabase” graphic when using the open source version or if you don’t have a paid Metabase subscription.
If you’d like to remove the “Powered by Metabase” attribution, check out our paid plans. In addition to removing the banner, you can also customize the font and hide the download buttons for questions.
With interactive embedding, you can add dashboards, charts, or even the entire Metabase interface into your own app with a fully branded experience.
We’ll first need to set up a running instance of Metabase to serve the embedded dashboards.
metabase.jar
file from your downloads to the /embedding-reference-apps/metabase
directory.cd
into /embedding-reference-apps/metabase
.java -jar metabase.jar
Once you’ve got Metabase running (on port 3000 by default):
localhost:3000
in your browser.To see an embedded Metabase dashboard in action, set up Metabase, and follow the instructions in the README for the relevant app. If you’re not sure which one to try, check out the Node app.
There are different ways to embed Metabase charts or dashboards in web applications.
The public embedding method is to simply use the public URLs inside of an iframe, or really anywhere you can insert HTML. The embedded dashboard has a secure URL, so a user can only look at the contents of the dashboard being shared. An end user never has information they can use to modify the URL and gain access to any other resources on your Metabase instance.
With static embedding, embedded questions and dashboards are be signed using a secret key. This allows you to build dynamic dashboards with a parameter that can be locked down on the client side. You should sign embedded questions and dashboards on your server, which allows you to embed dashboards accessible to specific organizations, accounts, or users.
The web applications go into more detail about embedding, and provide examples. Start up the Node app and explore the app.
Interactive embedding puts the entire Metabase app inside your app, so you can include the query builder in addition to your charts and dashboards. Interactive embedding isn’t covered in this repo. Check out the interactive embedding demo instead.
Check out the Metabase discussion forum and search for your issue. If you don’t find any answers, please create an issue for this repository.