The widget does not use your API key. The agent ID in the snippet is public. Never put an
ek_ key on a web page.When to use it
Use the widget when
Use the library when
Install
1
Copy the snippet
In the dashboard, open your agent. Go to Deploy → Web Widget → Embed Code. The snippet already has your agent ID.
2
Paste it into your page
Put it anywhere in
<head> or <body>. Keep defer.3
Serve the page over HTTPS
Browsers only allow the microphone, camera and screen capture on secure pages.
http://localhost also works for testing.index.html
Place the element yourself
The snippet above creates an<eclatira-widget> element for you. You can also write the element yourself. Put the agent ID in the agent-id attribute:
Two agents on one page
Two agents on one page
The automatic setup only runs once per page. To show two agents, add both elements yourself:By default, both buttons sit 24 px from the bottom-right corner, on top of each other. Give one of the agents a different
position_bottom or position_right.What the visitor sees
1
A consent screen
The panel first shows a Terms and Data Notice. The visitor must accept it. The browser remembers the choice, so a returning visitor sees it only once. You cannot turn this off.
2
A choice of mode
Voice, and Chat if text chat is on. Below them, Webcam and Share Screen if those are on.
3
The browser's permission prompt
The browser asks for the microphone. Webcam also asks for the camera. Share Screen opens the browser’s screen picker, then asks for the microphone.
4
The conversation
The header shows Connecting… and then a green Active dot. The agent speaks first. The visitor can interrupt it at any time.
Configuration
All settings live on the agent, not on the page. The snippet only carries the agent ID. When you change a setting, every page that embeds the agent updates on the next load. Change settings in the dashboard under Deploy → Web Widget.Features
Panel
Launcher button
On screens 480 px wide or less, the widget uses its own sizes. The button moves to 16 px from the corner, and the panel fills most of the screen.
If you change plans and your new plan does not include
hide_footer, the footer comes back right away. Your saved setting does not change.Turn camera or screen share on or off
enable_webcam and enable_screen_share control the widget and the API. When one is off, the widget hides the button, and the API refuses that session type. You can change them through the API:
How the widget handles video
The widget sends one image every second. Each image is a JPEG at quality 0.8, scaled so its longest side is at most 1024 px. If the connection is slow, the widget skips images so the audio is not held up. The server passes at most one image per second to the agent, and always the newest one. You cannot change these values in the widget. The client library lets you set them.Common problems
The widget never connects: require_auth is on
The widget never connects: require_auth is on
An agent with
require_auth on only accepts logged-in dashboard users. Visitors on your site are not logged in, so the connection closes with “Authentication required for this agent”. Turn require_auth off for any agent you embed.Origin not allowed
Origin not allowed
The agent’s
allowed_origins list is checked against the site the widget is embedded in. The widget then shows “This assistant isn’t available on this website.” Add the site’s domain to the list. An entry also covers its subdomains, so example.com allows www.example.com. An empty list allows every site.The list stops other sites from reusing your widget. It is not authentication: a client that does not run in a browser can claim to be any site.The agent never replies on some browsers
The agent never replies on some browsers
The widget asks the browser for 16 kHz audio and does not resample. Chrome and other Chromium browsers honor this. Some other browsers use the hardware rate instead. The audio then arrives at the wrong speed, and the agent never hears the visitor. No error appears.Test the widget on the browsers your visitors use. The client library resamples and does not have this problem.
"Stop sharing" does not end the session
"Stop sharing" does not end the session
If the visitor clicks the browser’s own Stop sharing bar, the images stop, but the session keeps running and keeps using credits. The visitor must click End session in the panel or close the tab.
Minimizing does not end the session
Minimizing does not end the session
Minimize only hides the panel. The conversation keeps running and the agent’s audio keeps playing. Only End session or leaving the page ends it.
See what the widget sees
The widget loads its settings from a public endpoint. Call it yourself to check them:require_authisfalse.subscription_blockedisfalse.required_variablesis empty, or each one has a default invariable_placeholders.widget_confighas the features you expect.
Limits
- Styling. You can only change the settings listed above. Your page’s CSS cannot reach the widget.
- No conversation data on your page. Your page cannot read transcripts or tool calls from the widget. There is no JavaScript API. Use a webhook to get the transcript when the session ends, or use the client library.
- HTTPS only. The microphone, camera and screen share do not work on plain HTTP pages, except
localhost. - Messages from other frames. The button accepts color and minimize messages from any frame on your page. Other frames can recolor or collapse it. They cannot start, read or end a session.
- Consent screen. The consent text and legal links are Eclatira’s and cannot be changed.