Embed the widget
Put a Wiselook assessment directly on your own website. End-to-end the flow is: provision a widget → wire your backend to mint sessions → drop the bundle on your page.
1. Provision a widget
In your tenant portal, create a widget. Choose its methodology and channel
(text or voice). Note the WIDGET_ID. Configure the allowed origins
to the domains the widget will be embedded on.
2. Wire your backend
Add a backend endpoint that mints a visitor session — see Mint a visitor session. The browser calls your endpoint; your endpoint holds the client secret and calls Wiselook. The secret never reaches the browser.
3. Embed the bundle
<div id="assessment"></div>
<script src="https://<WISELOOK_CDN>/widget.iife.js"></script>
<script>
(async () => {
const { token } = await fetch('/my-backend/wiselook-session')
.then((r) => r.json());
window.Wiselook.mount('#assessment', {
widgetId: 'WIDGET_ID',
token,
});
})();
</script>
The widget reads its configuration (methodology, channel, branding) from the bootstrap endpoint at mount time using the visitor JWT, then runs the assessment surface.
4. What the widget does
- Text channel — streams Claire's responses over SSE, rendering token-by-token.
- Voice channel — opens a WebRTC session; the visitor speaks and hears Claire.
When the assessment completes, scoring runs asynchronously. The visitor sees a completion state; results are available through your tenant portal and the Assessment API.
Troubleshooting
| Symptom | Likely cause |
|---|---|
401 minting the session | Client-credentials token missing or lacks widget_sessions:write. |
origin_not_allowed | The embedding page's origin isn't in the widget's allowed-origins list. |
| Widget mounts but won't start | Visitor JWT expired (>15 min) — mint a fresh one per page load. |
404 Widget not found | Wrong WIDGET_ID, or the widget was disabled. |