Bento Spaces documentation
14 — Widget catalogue
The widget backlog, split by where the data lives rather than by how popular a widget is. That split decides everything else: whether a widget needs a secret, whether it can be shared or exported, and whether it belongs in the marketplace.
Rule of thumb. Secret-free widget → shareable and exportable. Account or LAN widget → private in shared views, never in an export.
Tiers
| Tier | Data source | Sharing | Marketplace | Example |
|---|---|---|---|---|
| A | public, no key (Open-Meteo, RSS, CoinGecko, Frankfurter) | shareable | yes | weather, feed, markets |
| B | the user's account (calendar, todo, GitHub, Spotify) | private | maybe | "next meeting" |
| C | the user's LAN (connectors + bridge) | private | no | Gree AC, NAS, Pi-hole |
Tier A is what makes a marketplace look alive. Tier B is what makes people come back daily. Tier C is the moat: nobody else can put your six ACs, your NAS and your Pi-hole on one shelf with server-side rules.
What ships now
Built-ins in web/src/widgets/builtin/, registered in web/src/widgets/registry.js:
| Widget | Tier | Data | Notes |
|---|---|---|---|
| clock | A | none | two IANA timezones, optional seconds |
| countdown | A | none | one-off or yearly (birthdays), double-click to edit |
| weather | A | Open-Meteo | current, feels-like, today's high/low, two more days |
| feed | A | any public RSS/Atom | proxied through the API, 20 items, 15 min refresh |
| markets | A | CoinGecko + Frankfurter | coins with 24 h change plus FX rates |
| photo frame | A | image URLs | slideshow with cross-fade, 3–60 s per photo |
| qr | A | none | byte mode, versions 1–10, levels L/M/Q/H, drawn as SVG |
| sun & moon | A | Open-Meteo + local moon math | sunrise, sunset, daylight left, phase, illumination |
| unit converter | A | none | length, mass, volume, speed, area, data, time, temperature |
| dice & picker | A | none | d2–d100, up to 12 dice, or pick from a list |
| holidays | A | Nager.Date | next public holidays for a country, two years merged |
| crypto | A | CoinGecko market chart | price, 1/7/30/90/365-day change, sparkline |
| air quality | A | Open-Meteo air quality | European AQI, PM2.5, PM10, colour band |
| transit ("Departures") | A | TfL + BVG | next departures from a stop, 60 s refresh |
| stat, note, links, progress | A | none | static, local |
| http ("HTTP card") | C | account connector | one path mapped to dotted fields; Home Assistant / Gree / Pi-hole templates |
| ha ("Home Assistant") | C | account connector | one entity: state, unit, toggle via homeassistant.toggle |
All of these are secret-free except the Tier C trio, so they behave like any other widget in a shared view or an export. Tier C is gree, http and ha; see Connectors.
How a Tier A widget gets its data
Two paths, and the choice matters:
The QR encoder is local. web/src/lib/qr.js implements byte mode with Reed-Solomon correction and mask selection, and exposes its capacity so the tests can check every version and level against the published table. The matrices were also decoded with macOS Vision as a one-off check, including a screenshot of the rendered SVG — that is a verification step, not a runtime dependency.
- Direct fetch — the browser calls the public host. CSP only allows the three data hosts
- below, so this is a short list on purpose. Adding a host is a security change, not a config
- change.
https://api.open-meteo.com(weather)https://api.coingecko.com(coins)https://api.frankfurter.app(FX)https://air-quality-api.open-meteo.com(AQI)https://date.nager.at(public holidays)https://api.tfl.gov.uk(London departures)https://v6.bvg.transport.rest(Berlin departures)- Same-origin proxy —
GET /api/live/feed?url=…inBento.Api. Needed because feeds do not - send CORS headers. Account-only; public hosts only (no LAN, no loopback, no metadata); no
- redirects; 12 s; 512 KB; 5 min browser cache. The XML is parsed in
web/src/lib/feed.js, never - evaluated.
A widget that cannot load shows a short message in the box. It never throws, never blanks the shelf and never leaks the URL into a log.
Configuration
In edit mode each configurable widget shows a gear in its corner on hover. It opens one shared settings dialog — the same shell as Edit space — built from the widget's config schema. View-mode double-click stays free for shortcuts. What the dialog asks for:
| Widget | Double-click edits |
|---|---|
| clock | Europe/Malta \| America/New_York |
| weather | lat, lon, label |
| countdown | label \| 2026-12-25 \| yearly yes/no |
| feed | feed URL, one per line |
| photo frame | image URLs, one per line |
| markets | coins \| currencies \| base, e.g. bitcoin,ethereum \| USD,GBP \| EUR |
| qr | text or URL, optionally \| L, \| M, \| Q, \| H |
| sun & moon | lat, lon, label |
| unit converter | a sentence, e.g. 10 km to mi, 100 c to f |
| dice & picker | 6 \| 2 for two d6, or pick: Pizza, Sushi |
| holidays | MT, Malta (ISO country code, label) |
| crypto | coin id \| currency \| days, e.g. ethereum \| EUR \| 30 |
| air quality | lat, lon, label |
| transit ("Departures") | network (tfl or bvg), stop id, label |
| http ("HTTP card") | path, optional title, template and Label = dotted.path fields |
Next in Tier A
Cheap and secret-free, in rough order:
public transport— built: thetransitwidget reads TfL and BVG, two adapters with- different payload shapes; a new city is one parser beside them, not a new widget
- world clocks — a multi-zone variant of the clock (three or four cities in one box)
- sunrise/sunset strip — a 4x1 daylight bar for the current day
- currency calculator — combine the converter with live FX, cached hourly
Not Tier A, by definition: calendar, todo, email, GitHub, Spotify (Tier B) and anything behind a connector (Tier C).
Acceptance for a Tier A widget
- No secret, no account, no connector
- Renders a useful default with zero configuration
- Shows a readable message when upstream fails, offline or rate-limits
- All upstream text is escaped; links are
http(s)only and open withrel="noopener" - Works in a shared view and in an HTML export
- Has a node test for its parsing, and a browser test with mocked upstream