Skip to content

Web widget

The Hyponema widget is a self-contained browser bundle. Your backend creates a session, then the page passes the signed session URL to the widget.

Create the session from your server so the workspace API key never reaches the browser.

Terminal window
curl -X POST "https://api.hyponema.ai/sessions" \
-H "Authorization: Bearer $HYPONEMA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent_id": "agent_...",
"user_id": "user_123",
"modality": "voice+text"
}'

Return the ws_url or chat_url to your frontend.

<hyponema-widget
data-ws-url="wss://api.hyponema.ai/v1/sessions/SESSION_ID/ws?token=TOKEN"
data-mode="voice+text"
data-position="bottom-right"
data-button-label="Talk to us"
data-primary-color="#0369a1"
></hyponema-widget>
<script src="https://cdn.hyponema.ai/widget.js" async></script>
AttributeDescription
data-ws-urlVoice WebSocket URL returned by POST /sessions.
data-chat-urlChat WebSocket URL returned by POST /sessions.
data-modevoice-only, voice+text, or text-only. The widget exposes the -only suffixes; the underlying session API takes voice, voice+text, or text (drop the suffix when calling POST /sessions).
data-positionbottom-right, bottom-left, top-right, or top-left.
data-button-labelFloating button label.
data-opening-promptGreeting line shown before the session starts.
data-primary-colorBrand color for widget controls.
data-transcript-enabledWhether to show the transcript panel.
data-mute-enabledWhether to show the mute toggle in voice mode.
data-dismiss-enabledWhether to show the close control.
  • Create signed session URLs on your backend.
  • Use stable user IDs.
  • Add your site origin to the agent allowlist when origin checks are enabled.
  • Test microphone permissions in Safari, Chrome, and mobile browsers.
  • Review traces for the first beta sessions.