Important
To use your own Metabase, use the release branch that matches your Metabase Enterprise Edition's major version. For example, if you're using Metabase 1.53.x, use the 53-stable branch. More info.
To spin up a new Metabase, you can use any version branch and run the sample app in the Docker container with the corresponding version of Metabase. You'll need a Pro/Enterprise token, which you can get with a free trial of Pro..
This repository contains sample apps for Next.js 14 that uses Metabase Embedding SDK. It includes an app using pages router and an app using the app router.
Note: the samples are using the sdk Next.js compatibility layer, which is available from version 0.51.11.
This option should be used if you want to test Metabase Embedding SDK with your existing data.
cd either next-sample-app-router or next-sample-pages-router.
From this directory:
- Copy .env.sampleto.envand set the correct values
- Run npm install
- Run the app with npm run dev
The app router sample will start on port 3001 and the app router sample will start on port 3002.
This option should be used if you don't want to test Metabase Embedding SDK with your existing Metabase Pro/Enterprise instance for some reason.
From the root directory:
- Copy .env.docker.exampleto.env.dockerand replace<your_enterprise_token>with your premium embedding token
- Start all services in Docker with yarn docker:up
It will:
- Poll a Metabase image and run it
- Build and run containers with both next-sample-app-routerandnext-sample-pages-routerapps and run it
The pages router sample will start on port 4401 and the app router sample will start on port 4400.
- To run containers with a locally built metabase.jar, copy it to the./local-distfolder as./local-dist/metabase.jar.
- To run containers with a locally built Embedding SDK package, copy it to the ./local-distfolder as./local-dist/embedding-sdk.
- Run yarn docker:local-dist:upto start containers and use locally built dist from the./local-distfolder.
- To remove containers and images completely run yarn docker:rm.
Both apps provide an endpoint for user authentication, replace the logic to match your authentication system.