Product managers: send this page to your developers. They only need an embed id, an API key, your Vizkraft base URL, and the liquid tag names you configured.
https://app.vizkraft.com · Product: vizkraft.com
What you will build
- A backend route that calls Vizkraft with your embed API key and tenant liquid values, then returns only a short-lived
sessionTokento the browser. - A frontend page that installs
@vizkraft/embedand mounts the dashboard withgetSessionToken.
Prerequisites from your PM
Step 1 — Install
Step 2 — Backend mint
Create a server route your frontend can call (cookie / session auth on your side). That route calls Vizkraft:POST {baseUrl}/api/embed/session
Headers:
Authorization: Bearer <YOUR_EMBED_API_KEY>Content-Type: application/json
sessionToken (and optionally expiresAt). Never return the API key.
- cURL
- Node.js
- Python
Step 3 — Frontend mount
Call your backend fromgetSessionToken. Pass baseUrl when you are not on the default production host.
- JavaScript
- React
- HTML
Height tip
Useheight: '100%' when the host container is a flex/grid pane that should scroll inside the iframe. Percentage heights do not auto-grow from content. Pixel heights (or omitting height) allow the SDK to resize from viewer vizkraft:resize messages.
Step 4 — Session refresh
You do not build refresh timers. The SDK callsgetSessionToken:
- On mount
- Before session expiry (~5 minutes)
- After auth errors from the viewer
getSessionToken as a fresh mint each time (or a short cache on your backend if you prefer).
Step 5 — Verify
onReadyfires and charts load for tenant A.- Sign in as tenant B (or mint with different liquid) and confirm KPIs change—isolation works.
- Confirm your app origin is listed under Allowed origins in Vizkraft.
- Optional: walk through Partner demo on the same deployment.
API quick reference
VizkraftEmbed.mount(options)
Handle methods
postMessage (origins checked)
Common errors
Related
- Security — API key + liquid model
- Viewer options — themes and chrome toggles
- Admin setup — where PMs create keys
- Partner demo — end-to-end sandbox
- npm: @vizkraft/embed