Accommodation rate
—
Enable platform widgets · option 3 · demo
The platform draws the designer's card itself, from numbers its own server reads out of Metabase with a signed, locked request. Every pixel of the cards below is this page's HTML, so the design is fully under the platform's control.
Demo numbers. They are generated inside Metabase by three dummy-data questions and are not Enable figures.
Accommodation rate
—
Approval rate
—
Conversion rate
—
Reading live numbers from Metabase…
Each pair below is drawn from the same rows: on the left by the renderer as it shipped
before the dot (js/card-before.js, unchanged since SPARK-1), on the right by today's
js/card.js (SPARK-DOT-1). Under each pair, the rows the card drew from, exactly as fetched.
Environment shown: dev, with the scope picked above.
The QA page that showed no line had one merchant whose six applications all fall in the current 30-day window. These rows hold the numbers recorded for that window in DEV-SHEET-v2 (November 3); this page does not hold that merchant's id and does not read it live. One window: before shows nothing under the number, now shows the dot.
The same three cards in each environment, for the scope picked above, drawn by today's
js/card.js from that environment's own question. Each column says which question it read.
A line needs two 30-day windows with a value. When a scope has only one (every application
is newer than 30 days), the card draws a single dot at that value and says "trend after 30 days"; from the
second window on it draws the line. Example rows, not live: both cards below are drawn by the
same card.js from fixed rows in js/app.js (the first: 1 window; the second: 12 windows).
GET /api/embed/card/<token>/query, server to server. Metabase answers no other site's
browser (it sends no cross-origin headers), so this step cannot happen in the page./api/widgets here).Every code block below is fetched from the file this demo actually runs, so it cannot drift from what you see working above.
HS256 over resource.question, params (every locked filter, one value each) and
exp. File: /code/sign-token.js.
Loading…
The demo's server is a Cloudflare Pages Function. It holds three finished, expiring tokens per scope as a
Cloudflare secret, never the signing secret. File: /code/widgets-handler.js (re-exported by
functions/api/widgets.js).
Loading…
Loading…
Loading…
The response this page just received from /api/widgets (first two rows of each widget shown).
Decimal cells arrive as JSON strings ("0.468800"): parse every numeric cell with
Number(), and treat null or "" as "no value", never as zero. Window dates
roll daily.
Loading…
Value = the latest window's rate as a whole percent. Change = relative change against the previous window,
the same arithmetic as Metabase's trend widget. File: /js/card.js.
Loading…
Loading…
Loading…
Every Metabase id belongs to one environment: the numeric ids (470, 211, …) and the entity_id
strings alike. Metabase does not keep a supplied entity_id when a card is created, so a copy in
another environment gets new ids of both kinds (checked on October 26, 2026).
{question: <numeric id>} or {question: "<entity_id>"}. Both returned 202
for all six dev questions. The packet's signers accept the numeric form only.entity_id in a dev token
is refused (400).| Object | Production | Dev |
|---|---|---|
| Collection | 178 | 67 |
| Questions | 470–475 | 67–72 |
| Dashboard | 211 | 34 |
Details, with each question's entity_id: the packet's
shared/signing-and-fetching.md, section "Ids are per environment".
exp. Metabase accepts a token without one, and it would never expire.