Hub Page Widgets
Hub pages support six live-data widget blocks that fetch from any HTTP API and render the results inline. Widgets are added through the page editor, no code deployment. A widget fetches straight from the reader's browser, or through Yroun's server-side Connection proxy when the API needs a credential that must never reach a browser.
Building widgets programmatically via REST? See Open API → Content & Widgets for the Tiptap node JSON shape and Open API → Recipes for copy-paste curl flows.
Widget types
Bookmark cards
Paste a bare URL on an empty line and a small menu offers Link / Bookmark / Embed. Bookmark turns it into a Notion-style preview card with the site's title, description, image, and favicon. You can also type /bookmark in the editor. The preview is captured once when you add it, so readers never trigger a refetch.
Safety: cards always open in a new tab, and following a card to a site outside yroun.com shows a confirmation with the real destination domain first.
Adding a widget to a page
Endpoint presets
Instead of pasting a full URL into every widget, you can define named base URL presets at the hub level and reference them by name.
Endpoint presets are per-hub. If you update a preset URL, all widgets referencing it pick up the change automatically, no individual widget edits needed.
Choosing an auth mode: one question decides it
Who controls the API the widget calls? That single question picks the right mode. Our recommendation order:
Details for each mode follow.
Authorization modes
Yroun ID auth: how it works
When Yroun ID mode is active, Yroun issues a short-lived identity token (5 minutes) for every signed-in viewer and sends it to your API as Authorization: YrounWidget <token>. The token's subject is a pairwise viewer id, stable for the same viewer on the same hub, but different across hubs and never linkable to the Yroun account. Anonymous visitors send no token. The token is scoped only for identity verification. It cannot be used to call Yroun's own APIs.
Your backend verifies it with your own API key. Each verification is metered against your credits, never the viewer's:
# Verify a Yroun widget token from your own server
curl -X POST https://api.yroun.com/oapi/widget-tokens/verify \
-H "X-API-Key: yroun_key_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{ "token": "<value after the YrounWidget prefix>" }'// 200: verdict is in the body, not the status code
{ "valid": true, "viewerId": "3f9c…32-hex, stable per (viewer, hub)", "hubUid": "…" }
// expired or forged token
{ "valid": false, "viewerId": null, "hubUid": null }This lets you build per-viewer experiences on your own API, such as personalization, rate limiting or your own access rules keyed on viewerId, and display them securely inside a Yroun hub page, without sharing any Yroun credentials with your server.
Header format
For SESSION and PERSONAL TOKEN modes you can customise the header name and method prefix:
Example: Header Name = X-My-Token, Method = (empty) → X-My-Token: <token>
CONNECTIONS: server-side proxy (recommended)
A Connection stores an external API credential once at hub level; widgets that select it fetch through Yroun's server, which injects the secret per request. The secret is encrypted at rest and never sent to any browser.
Only http(s) URLs to public hosts are accepted; requests to private/internal network ranges are rejected by the proxy.
Viewer identity on proxied requests: when a signed-in reader triggers the fetch, the proxy adds X-Yroun-Viewer (the same per-hub pairwise viewerId that widget-token verification returns) and X-Yroun-Hub headers to the outbound request, so your API gets the server-held credential AND per-viewer identity together. Anonymous viewers and machine callers send neither header; absent means anonymous.
PERSONAL TOKEN (saved): step-by-step walkthrough
A saved personal token is the right choice when each viewer should call the data source with THEIR OWN credential, e.g. everyone on the team has their own token for an internal service, or a per-user third-party API key. Nothing is shared between viewers: the widget names a token (sharedKeyName), and every viewer supplies their own under that name. For ONE hub-held secret that serves all viewers, use a CONNECTION instead.
API Table: column mapping
After entering the API URL, select 'Fetch columns' to auto-detect fields from the response. Map each field to a column label and choose a display type: text, number, date, or badge. Use 'Data root key' if the array is nested: e.g. data.items returns the items array.
Pagination, filters, total count
The API Table widget assumes a page-based contract by default: page number + size as query params, content + totalElements in the response. Filters become extra query params, one per filter control. Sorting passes a sort param, with a leading '-' for descending.
# Default request shape the widget sends
GET https://your-api.example.com/items?page=1&size=20&sort=-createdAt&status=ACTIVE
# Default response shape the widget expects
{
"content": [ { ... }, { ... } ],
"totalElements": 1234,
"totalPages": 62,
"pageNumber": 1,
"pageSize": 20
}apiMapping: adapt the widget to any API shape
Query and response field names are NOT hardcoded. Every widget instance exposes an apiMapping config block that remaps the widget's six logical fields onto whatever your backend uses. This is the widget's headline strength: you can point it at an API you already shipped, such as your own service, a third-party REST endpoint or an internal analytics service, without changing a single line of backend code.
The six logical fields (and their defaults):
{
"apiMapping": {
// request: where the widget puts the value
"reqPageNum": "page", // query param name for page number
"reqPageSize": "size", // query param name for page size
"reqSort": "sort", // query param name for sort
"reqSearch": "search", // query param name for the search box
// response: where the widget reads the value (dot path)
"resItems": "content", // array of rows
"resTotal": "totalElements" // total row count
}
}Concrete remaps. Same widget, three completely different APIs:
// Your existing Express API returns { rows, total, currentPage }
{ "reqPageNum": "p", "reqPageSize": "limit",
"resItems": "rows", "resTotal": "total" }
// A third-party API returns { data: { results, count }, meta: {...} }
{ "reqPageNum": "page", "reqPageSize": "per_page",
"resItems": "data.results", "resTotal": "data.count" }
// An Elasticsearch-backed endpoint returns { hits: { hits, total: { value } } }
{ "reqPageNum": "from", "reqPageSize": "size",
"resItems": "hits.hits", "resTotal": "hits.total.value" }CRUD response shapes
Inline create / edit / delete row actions follow standard REST conventions:
POST /items → 201 Created with the created row in the body
PATCH /items/{id} → 200 OK with the updated row in the body
DELETE /items/{id} → 204 No Content (empty body)Errors return { error, message } with a 4xx status. The widget surfaces the message in the row's inline error banner, never silently.
API Chart: filter controls
Add filter controls to let readers slice the chart data without editing the widget. Each filter maps to a URL query parameter. When the reader changes a filter, the widget re-fetches and re-renders.
API Request: body modes
API Queue: grouped work queues
API Queue turns any paginated list endpoint into a status-grouped operator queue: rows are bucketed by a field you choose (typically status), each group gets a colored badge and header, and the widget re-fetches on an interval so state changes appear without a manual refresh. Selecting a row emits a page-level event that sibling widgets can listen to, and can optionally navigate to a URL template built from the row.
Inserting one from the block picker starts it pre-wired to a public sample endpoint grouped by status. Swap in your own endpoint when ready.
To configure it right in the page editor, select the gear icon in the widget header: the inline settings panel puts the essentials up front (title, API URL, auth, group-by field) and keeps the response mapping, polling/row tuning, and the JSON fields (group labels, badge colors, row columns) under an Advanced toggle. Everything can also be set programmatically via the block attrs below.
Key configuration (all editable per widget):
API Queue is an operator surface: it fetches only for the hub owner and admins. Regular readers see the widget frame without data. Put it on an admin/staff-visibility page rather than a public one.
Stuck, or something here is wrong? Send us a message