Embed dashboards & reports
Seamlessly embed a Yurbi dashboard or report in your app, and log users in automatically with a session token.
Yurbi embeds through the same session-token system as the rest of the API. The flow: get a token, build an embed URL with it, drop that URL in an iframe. Optionally log users straight into the full Yurbi interface.
1. Get a session token
Call DoLogin to get a token (see
Authentication & sessions):
curl -X POST "https://your-yurbi-server.com/api/login/DoLogin" \
-H "Content-Type: application/json" \
-d '{ "bolForceLogin": true, "isGuest": false, "UserId": "user", "UserPassword": "password" }'
The token comes back in LoginSession.SessionToken.
One Yurbi user per end user. Yurbi maintains a single session per account, so a new login ends that account's previous session. Embedding for several people through one shared account means each page load signs the previous viewer out. Provision a user per end user, and cache each user's token on your server rather than logging in on every page view.
2. Build the embed URL
Append the token to an embed URL. Use t=d for a dashboard, t=r for a report,
and i= for the item's ID:
Dashboard: https://your-yurbi-server.com/embed.html?t=d&i={dashboardId}&s={sessionToken}
Report: https://your-yurbi-server.com/embed.html?t=r&i={reportId}&s={sessionToken}
Place either URL in an <iframe> on your page:
<iframe src="https://your-yurbi-server.com/embed.html?t=d&i=123&s=LVPACMJFBMZK..."
width="100%" height="700" frameborder="0"></iframe>
Path note.
/embed.htmlis the Linux/Docker (and Windows root-web) path. On a default Windows install it's/yurbi/embed.html. The API base is separate — see Platform paths.
3. Find dashboard & report IDs
Edit the dashboard or report in Yurbi; the ID appears at the top-right of the edit sidebar. You can also resolve IDs programmatically with the Library calls.
All you need to embed is the item's ID and a valid session token. The "Allow embed" checkbox in the library is cosmetic — it only adds a Share action to the library menu; it is not required for an embed to work. If you want a view with no login at all, enable Anonymous / Public view when saving the item.
4. Pass report prompts (optional)
If a report has prompts, you can pre-fill them in the URL with isprompt=true and
indexed prmpt* parameters — the Embed Library in Yurbi builds these for you:
https://your-yurbi-server.com/embed.html?t=r&i=1739550061&isprompt=true&prmpt0low=11000&prmpt0skipped=false&s={sessionToken}
5. Keep the session alive
A token expires at its SessionExpir time, 20 minutes after the last call by
default. The window rolls forward on every authenticated request, so an embed
someone is interacting with keeps itself alive.
For an embed that may sit untouched, call
RefreshSession before the expiry and
CheckSession to test validity.
The token is visible in the embed URL. It appears in the iframe
src, and so in browser history and any referrer headers. Use a per-user token, keep the session timeout short, and prefer anonymous view for content that needs no user identity at all.
6. Seamless login to the full app
Beyond single items, you can drop a user directly into the Yurbi interface with a
valid token via sso.html — see Single Sign-On for the
full walkthrough:
Dashboard: https://your-yurbi-server.com/sso.html?s={sessionToken}
Library: https://your-yurbi-server.com/sso.html?s={sessionToken}&h=1
Builder: https://your-yurbi-server.com/sso.html?s={sessionToken}&h=2
For provider-driven login (where your identity provider authenticates the user and
Yurbi logs them in automatically, no DoLogin call), see
Header-based SSO (advanced).
Endpoints used
DoLogin— get the tokenCheckSession— validate itRefreshSession— extend it