/rill-embedding-test

Example of embedding a Rill dashboard in a Next.js project

Primary LanguageJavaScriptApache License 2.0Apache-2.0

Rill embedding example

Netlify Status

This is a basic Next.js project that embeds a Rill dashboard. It embeds the demo/rill-openrtb-prog-ads/bids dashboard and is deployed using Netlify to rill-embedding-example.netlify.app.

See the Embed Dashboards docs page for more details.

Developing

First, create a Rill service token:

rill service create rill-embedding-token

Second, write it to a .env file (which is gitignored):

cat "RILL_SERVICE_TOKEN=<INSERT TOKEN>" > .env

Third, update the rillOrg, rillProject, and rillDashboard variables in pages/api/iframe.js to reflect the dashboard you want to embed:

const rillOrg = "demo";
const rillProject = "rill-openrtb-prog-ads";
const rillDashboard = "bids";

Lastly, run the development server:

npm install
npm run dev

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