Skip to content

scheide/metabase-embedding

Repository files navigation

Metabase Static Embedding

Next.js License Node

Before embedding, remember to publish your dashboard by following these steps:

  1. Click on "Sharing" icon:

    Sharing

  2. Select "Embed" option:

    Embed

  3. Click on "Publish" button:

    Publish

Configuring Environment Variables

Create a .env file in the root of your project with the following content:

METABASE_SITE_URL=http://localhost:3000
METABASE_SECRET_KEY=<YOUR_METABASE_SECRET_KEY>

Updating Payload

Update page.tsx with your dashboard payload. You can see it on the embedding page.

Example:

const payload = {
    resource: { dashboard: 2 },
    params: {},
    exp: Math.round(Date.now() / 1000) + (10 \* 60) // 10 minute expiration
};

Installing and Running

First, install the dependencies by running:

npm install

Then, run the development server:

npx next dev

Open http://localhost:3000 with your browser to see the result.

Licensing

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published