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…
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…
exp. Metabase accepts a token without one, and it would never expire.