This Node application demonstrates a simple, barebones Metabase dashboard embedded in a web application using static embedding.
-
Metabase. Install and run a fresh Metabase in the
metabase
directory of this repository. -
Enable embedding. Make sure to enable embedding in your Metabase.
-
Node. You'll need Node installed on your machine to run the application.
-
Yarn. You'll need the Yarn package manager to install the application's dependencies.
-
In a new terminal session,
cd
into this directory. -
Run
yarn install
to install the application's dependencies. -
Once the application dependencies are installed, run
yarn start
or:
node index.js
- Open your browser to localhost:3001 (or the port where this application is running).
Explore the app to learn more about embedding Metabase charts and dashboards in applications. You can also check out the links to more documentation in the parent repository's main README.
- Go to your Metabase at
localhost:3000
. - Click on the gear icon > Admin settings.
- Click **Embedding > Standalone embeds.
- Check that the embedding secret key matches the embedding key in
index.js
. - If the keys don't match, copy the secret key from your Admin settings and replace the secret key in the
index.js
file.
If that doesn't work, try cloning a fresh repo and running a new JAR file.
You can find example code for Metabase embeds for:
- Charts. See views/chart.pug.
- Dashboards. See views/dashboard.pug.