Web embed
Drop a voice assistant onto any page on your site — popup launcher or inline frame. One script tag, a domain allowlist, and you're live.
The dBel web embed turns any page on your site into a voice channel for your assistant. Visitors click a button (or land on an inline page) and start a real-time WebRTC voice call with the same assistant that handles your phone calls. It uses the same prompt, the same knowledge base and the same functions, except for the two that need a phone line. Call transfer and SMS do not work in a web session: the assistant tells the visitor they are only available on phone calls, and the call's function results record the attempt as skipped.
This guide covers: the one-line install, what the customer-provided attributes do, the two render modes, how to identify signed-in visitors, theming, what counts as a session, and the common rollout pitfalls.
1. Setup (one-time)
There are three pieces — enabling the widget on an assistant, listing the origins it's allowed to load from, and pasting one script tag on your site.
- In the sidebar, open Channels → Web Widget. (To change the settings, you must have created the assistant, or be a workspace Owner or Admin. Everyone else sees them read-only.)
- Pick the assistant in the Assistant selector. Turn on the Enable widget switch.
- Under Allowed origins, add every site origin that may load the widget, then click Save changes. Only the Enable widget and branding switches save on their own; every other setting on the page waits for Save changes. Origin = scheme + host + optional port. Each origin is an exact match unless you use the single-level wildcard form.
https://example.com ← apex site
https://www.example.com ← www subdomain (separate origin)
https://app.example.com ← app subdomain
https://*.example.com ← any single-level subdomain
http://localhost:5500 ← local dev (only http://localhost / 127.0.0.1)http://example.com is rejected at save — browsers refuse microphone access on non-HTTPS pages, so an insecure customer origin would fail at runtime anyway.
Prefer exact origins. A wildcard entry trusts every subdomain of that domain, including one a third party hosts for you (a help desk or a landing-page tool, for example). Anyone who loads the widget can also read the list of allowed origins, so don't list an origin you want to keep private.
Your plan limits how many origins one assistant can list: 1 on Free, 3 on Seed, and up to 50 on Growth and above. A wildcard entry or a localhost entry counts as one.
- Copy the Install snippet from the same page. Paste it into the
<head>or end of<body>on every page where the widget should appear:
<script
src="https://dbel.ai/embed.js"
data-dbel-assistant="YOUR_ASSISTANT_ID"
data-dbel-mode="popup"
async
></script>That's it. Visit a page on an allowed origin. A round launcher button with a waveform icon appears bottom-right. Click it to test: the launcher appears on any page, and dBel checks the origin only when the visitor clicks.
2. Attribute reference
All configuration lives on the <script> tag itself. The loader reads its own attributes at runtime, so multi-page sites can vary mode/metadata per page without re-bundling.
| Attribute | Required | What it does |
|---|---|---|
data-dbel-assistant | yes | The assistant ID. The dashboard's install snippet fills it in. It also appears in the Web Widget page URL as ?assistantId=. |
data-dbel-mode | no | popup (default) renders a floating launcher; inline injects the call UI directly into a container on your page. |
data-dbel-target | no | CSS selector for the inline container (e.g. #dbel-mount). Without it, the widget goes right after the <script> tag, or at the end of <body> if the tag is in <head>. The dashboard snippet does not include it, so add it yourself for inline mode. Ignored for popup. |
data-dbel-visitor-name | no | Optional label for the visitor (max 120 characters). dBel uses it only as the visitor's display name inside the voice session. The assistant does not read it, and dBel does not save it. To save a name, put name in data-dbel-visitor-metadata. |
data-dbel-visitor-metadata | no | JSON object with whitelisted identity keys that qualify the visit as a Contact (see §4). |
data-dbel-theme | no | light / dark / system — overrides the assistant's saved theme on this page. |
data-dbel-color | no | #RRGGBB — the popup launcher colour. The dashboard snippet fills it in when you set a custom Accent color. |
data-dbel-page-context | no | Written by the dashboard when Page context is on (Seed and above). Lists which parts of the page the loader may read. |
data-dbel-context-selector | no | Written by the dashboard when Page context is on and you set the page areas to read. |
data-dbel-context-max-chars | no | Written by the dashboard when Page context is on and you change the visible-text limit. |
data-dbel-debug | no | true logs page-context debug lines to the browser console. The lines contain no page content. |
There is no data-dbel-visitor-identity attribute. dBel sets the visitor's session identity on the server for every session; customer pages can't override it.
With Page context on, the loader also reads optional tags that you put on elements of your own page (not on the <script> tag): data-dbel-context (names a page section), data-dbel-field (marks a visible value), data-dbel-action (marks an important button or link), and data-dbel-private / data-dbel-ignore (the loader skips that element and everything inside it). The Page context section on the Web Widget page has examples.
3. Modes — popup vs inline
Both modes are delivered via the same iframe (https://dbel.ai/embed). The difference is how the loader renders that iframe on your page.
Popup (default)
<script
src="https://dbel.ai/embed.js"
data-dbel-assistant="YOUR_ASSISTANT_ID"
data-dbel-mode="popup"
async
></script>- A small launcher button appears in the bottom-right corner.
- Click → an iframe popup expands above it (380×560, rounded, on a high z-index).
- Click ✕ to end the call and dismiss the popup.
No layout work needed. Drop the snippet in your site's global template (<head> or footer partial) and it appears on every page.
Inline
<div id="dbel-mount" style="height: 600px;"></div>
<script
src="https://dbel.ai/embed.js"
data-dbel-assistant="YOUR_ASSISTANT_ID"
data-dbel-mode="inline"
data-dbel-target="#dbel-mount"
async
></script>- The widget renders directly inside your container.
- The container controls the size. The iframe fills 100% width / height of its parent (with a 480 px minimum height fallback).
- The visitor sees a Start call button first. Clicking it starts the session, or opens the pre-call form if you set one up. The widget does NOT auto-start mic on page load.
If data-dbel-target doesn't match an element on the page, the iframe falls back to being inserted right after the <script> tag (or at the end of <body> if the script is in <head>).
4. Identifying signed-in visitors
If your site already knows who the visitor is, pass their details in data-dbel-visitor-metadata. dBel saves them on the Call and uses them to link the Call to a Contact. The assistant does not read these values during the call, so it cannot greet the visitor by name.
<script
src="https://dbel.ai/embed.js"
data-dbel-assistant="YOUR_ASSISTANT_ID"
data-dbel-mode="popup"
data-dbel-visitor-metadata='{"email":"jane@acme.com","name":"Jane Doe","company":"Acme","customerId":"C-42"}'
async
></script>A web visit becomes a Contact in one of three ways. In each case dBel creates or links the Contact when the session ends. The one exception is a returning browser that already has a Contact: dBel links its Call to that Contact when the call starts.
Path A — captured during the call. The visitor says "my email is jane@x.com", and an info function records it. The function must have the Email information type, or a name such as email, phone, name, company or customerId. dBel creates a Contact (source = WEB) at session end and links the Call to it. The captured value stays in the Call's function results. When the function has the Email information type and the address looks valid, dBel also copies it onto the Contact at session end, if the Contact's email is empty. Other captured values are not copied onto the Contact.
Path B — passed from your page. You render the snippet server-side with the signed-in user's details in data-dbel-visitor-metadata. If it contains a whitelisted key with a value, the visit qualifies, and dBel creates or links the Contact without the assistant needing to ask.
Path C — pre-call form (Seed and above). Set up the Pre-call form on the Web Widget page. Each field (name, email, phone) can be off, optional or required. The visitor enters their name, email or phone before the call starts. dBel handles these values the same way as Path B.
Only keys from this whitelist qualify a visit as a Contact:
email, phone, name, fullName, company, companyName, customerIdWhat dBel does with each whitelisted key:
email,nameandfullNameare copied onto the Contact. They fill a blank field only; they never overwrite an existing value.phoneis saved on the Contact as a number the visitor typed, which dBel has not verified. It does not link the Contact to phone calls from that number. If a phone-call contact in your workspace already has that number, dBel suggests a merge for you to review. Pass the number in international format, such as+15551234567; dBel saves it on the Contact only if it is a valid number.company,companyNameandcustomerIdqualify the visit, but the Contact has no field for them. They stay on the Call record and in the post-call webhook.
Other keys are not saved. dBel does not store them on the Call or send them in the webhook, and the assistant does not read them. One key is used without being saved: phoneRegion (a country code such as "US") tells dBel how to read a phone written without a country code. So {"page":"/pricing","tier":"enterprise"} does nothing, and it does not create a Contact.
Limits: up to 20 keys, key ≤ 64 chars, value ≤ 512 chars, scalar values only (string / number / boolean / null). Nested objects and arrays are rejected. If the metadata breaks these limits, or data-dbel-visitor-name is longer than 120 characters, dBel refuses the session. The widget shows "The request body is invalid." and no call starts. If the attribute is not valid JSON, the loader ignores it and the call starts without metadata.
5. End-to-end snippets
Anonymous visitor (most sites)
<!-- Drop into your site's global template -->
<script
src="https://dbel.ai/embed.js"
data-dbel-assistant="YOUR_ASSISTANT_ID"
data-dbel-mode="popup"
async
></script>Every visitor sees the launcher. A browserVisitorId is generated client-side (UUID in their browser's first-party localStorage) and persists across page loads. Visits that capture identity become Contacts; drive-by visits stay as Call rows only.
Logged-in customer
<script
src="https://dbel.ai/embed.js"
data-dbel-assistant="YOUR_ASSISTANT_ID"
data-dbel-mode="popup"
data-dbel-visitor-metadata='{"email":"{{user.email}}","name":"{{user.fullName}}","customerId":"{{user.id}}"}'
async
></script>Render server-side so the template variables resolve before the script tag ships. When the visitor's first session ends, dBel creates a Contact with their email and name. Later sessions from the same browser link to that Contact when they start.
Inline frame on a contact page
<section class="contact-section">
<h2>Talk to our team</h2>
<div
id="dbel-mount"
style="height: 640px; max-width: 480px; margin: 0 auto;"
></div>
</section>
<script
src="https://dbel.ai/embed.js"
data-dbel-assistant="YOUR_SUPPORT_ASSISTANT_ID"
data-dbel-mode="inline"
data-dbel-target="#dbel-mount"
async
></script>Inline is best for dedicated "Talk to us" pages where you want the call UI in the document flow rather than floating over the page.
React / Next.js
import Script from "next/script";
export default function Layout({ children }: { children: React.ReactNode }) {
return (
<>
{children}
<Script
src="https://dbel.ai/embed.js"
strategy="afterInteractive"
data-dbel-assistant="YOUR_ASSISTANT_ID"
data-dbel-mode="popup"
/>
</>
);
}next/script with strategy="afterInteractive" is the right fit — equivalent to a regular async script tag without blocking hydration.
Single Page Apps (Vue, Svelte, Angular)
Append the <script> tag once when your shell mounts. The widget runs across client-side navigations — it owns its own iframe lifecycle and isn't tied to your router. Add the tag only once. Removing the <script> element later does not remove the launcher, and adding it again draws a second launcher.
6. Theming
Set per-assistant defaults on the Web Widget page:
| Setting | Effect |
|---|---|
| Theme | System (default), Light or Dark — the widget's colour scheme. data-dbel-theme overrides it on one page. |
| Accent color | #RRGGBB — tints the voice visualiser and the header mark. The install snippet also carries it to the popup launcher. |
| Widget text | Optional header text, and the prompt above the Start call button. |
The popup launcher always sits in the bottom-right corner and always shows the dBel waveform icon. There is no setting for its position or icon.
After you click Save changes, the widget uses the new theme, accent and text on the next call, with no change to your site. One exception: the popup launcher's colour comes from the install snippet, so re-copy the snippet after you change Accent color.
7. Branding
The widget footer shows Powered by dBel by default, with the dBel mark in the widget header. Free workspaces cannot remove them. On Seed and above, turn on Hide "Powered by dBel" in the Branding section of the Web Widget config (it saves on its own). Both then stay hidden on every screen: the Start call screen, the pre-call form, while the call connects, during the call, on an error screen, and after the call ends. One exception: if a temporary error stops dBel from checking your plan when the widget loads, the badge shows until the page loads again.
dBel checks your plan each time the widget loads (the answer can be up to a minute old) and again when each call starts. If a workspace downgrades from Seed to Free, the badge comes back when a visitor next starts a call, or loads the widget a minute or more after the change. If a workspace upgrades, the badge disappears from the next page load; a page that is already open keeps showing it. You do not need to change the embed code.
8. Lifecycle — what counts as a session
- Page load does NOT start a session or request the microphone. The loader paints the launcher and waits. (It does store the visitor ID — see §9.)
- Click launcher (popup) or click Start call (inline) requests the microphone, then requests a short-lived session token (10 minutes) and starts the WebRTC connection. If you set up a pre-call form, the visitor fills it in first.
- Browser tab close / page navigation ends the session in seconds — the room emits a
participant_disconnectedevent and minutes stop accruing. - Idle silence for ~36 s ends the session automatically (warn → final warn → hangup ladder).
- Plan limits apply to every session. They come from the workspace owner's plan: a maximum call length (5 minutes on Free, 30 on Seed, 60 on Growth, 120 on Hypergrowth) and the plan's minute allowance (a one-time 5 minutes on Free). When the allowance is used up, a new session hears a short busy message and ends.
- Concurrent calls: web sessions and phone calls share the workspace's concurrent-call limit (1 on Free, 5 on Seed, 20 on Growth, 40 on Hypergrowth). A session over the limit hears a short busy message and ends. On Free, one live web session makes the next visitor, or a phone caller, hear that message.
Each call creates a Call row visible in the dashboard's Call Logs with callType = WEB. Filter the dropdown for "Web" to see only widget calls.
9. Privacy
- As soon as the page loads, the loader writes a
browserVisitorId(a random UUID) to first-partylocalStorageon your origin. It does this for every visitor, before any click. The ID persists across page loads and lets returning visitors land on the same Contact. - The page's origin (scheme, host and port — e.g.
https://example.com, not the page path) is saved on theCalland sent in the post-call webhook. - The whitelisted visitor metadata (§4) is saved on the
Calland sent in the post-call webhook. - If you set up the Pre-call form, the visitor's name, email and phone are saved on the Call and copied onto the Contact as described in §4.
- If you turn on Page context (Seed and above), the loader sends the assistant live context from the visitor's page. Depending on the parts you pick, this is the page URL, title and referrer (without query strings), any text the visitor selects, visible text, link and button labels, form-field labels (never input values or passwords), recent clicks, page changes and field focus, and your
data-dbel-*tags. dBel saves only the URL and title of each page on the Call. The rest is used during the call and not saved. - dBel does not save the visitor's IP address or user agent on the Call. The token endpoint uses the IP address for rate limiting.
- No third-party cookies are set. The widget does not federate identity into any external analytics tool.
Update your site's privacy policy if your jurisdiction (GDPR, CCPA) requires you to disclose persistent visitor identifiers — browserVisitorId is pseudonymous personal data.
10. Rate limits
The token endpoint applies three layers, all run in parallel before any database lookup:
| Layer | Scope | Limit | What it stops |
|---|---|---|---|
| 1 | per-IP global | 60 sessions / min | Random assistant-ID spray from a single host |
| 2 | per-IP + assistant | 20 sessions / hour | One host repeatedly starting sessions on a known assistant |
| 3 | per-browserVisitorId + assistant | 20 sessions / day | One persistent visitor monopolising the embed across IP changes |
Most visitors never reach these limits. If a legitimate scenario hits them (for example, a kiosk where many people share one IP), get in touch. The limits are the same for every workspace, and there is no per-origin override.
11. Troubleshooting
The widget says "The assistant didn't respond", and the console shows a CORS error on /api/web/token
The page's Origin doesn't match any entry in Allowed origins on the assistant. dBel refuses the request without the header the browser needs to read the reply, so the browser reports a network error in the console. The wording depends on the browser. The widget accepts messages only from a page on the list, so it shows "The assistant didn't respond. Please try again." after about 12 seconds. If the widget instead says "Assistant not found or you do not have access.", the assistant could not take calls when the visitor clicked. This happens in two cases:
- Someone turned off Enable widget, or deleted the assistant or its workspace, after the visitor loaded the page.
- The assistant could not take calls when the page loaded either (switched off, deleted, or a wrong ID), but a temporary error stopped dBel from checking that. In this case the widget shows a normal Start call screen, and the call then fails.
Common causes of an origin mismatch:
- Not saved — you added the origin but did not click Save changes.
- Not reloaded — the widget reads the list when the page loads. After you save a change, reload the page.
- Scheme mismatch —
https://example.comallowed, page loaded overhttp://example.com. Serve the page over HTTPS. dBel accepts anhttp://origin only forlocalhostand127.0.0.1. - Port mismatch —
https://example.comallowed, page onhttps://example.com:8443. Add the explicit port. - Subdomain mismatch —
https://example.comallowed, page onwww.example.com. Addhttps://www.example.com(apex andwwware separate origins) or usehttps://*.example.com. - Wildcard too deep —
https://*.example.commatcheshttps://app.example.combut NOThttps://app.staging.example.com. Add another wildcard for the deeper level.
Each extra entry counts toward your plan's origin limit (§1).
Microphone permission prompt fails or never appears
The loader sets allow="microphone" on the iframe. If the prompt still fails, your site probably sends a Permissions-Policy response header that blocks the microphone for other origins. Permissions-Policy is a separate header, not part of your Content-Security-Policy. Allow dBel in it:
Permissions-Policy: microphone=(self "https://dbel.ai")Two embeds on one page collide
The handshake nonce in each iframe URL prevents this — the loader matches messages by source + origin + nonce, so a click on one widget doesn't fire the other. If you see odd behaviour with multiple widgets, check your DevTools Network tab; you should see one POST /api/web/token per launcher click, not duplicates.
Two popup snippets on one page draw two launchers in the same bottom-right spot, one on top of the other. Use one popup per page, and use inline mode for a second assistant.
The widget says "This assistant isn't available."
The widget shows this line, and no Start call button, when it cannot take calls. This happens in three cases:
- Enable widget is off for the assistant.
- The assistant, or its workspace, was deleted.
- The assistant ID in
data-dbel-assistantis wrong.
The widget shows the same line in every case, with none of the assistant's name or colours. Turn on Enable widget, or fix the ID, and the widget works on the next page load.
The launcher or inline frame never appears
The allowlist does not stop the widget from rendering. It makes the session fail after the visitor clicks. A switched-off or deleted assistant still renders the widget, with the line above. If nothing renders, check three things:
- The script
srcis exactlyhttps://dbel.ai/embed.js. - The tag has
data-dbel-assistant. Without it, the loader does nothing. - If your site sends a Content-Security-Policy, it allows
https://dbel.aiinscript-src(the loader),connect-src(the token request) andframe-src(the widget iframe).
Localhost testing
Set up the assistant with http://localhost:3000 (or whatever port your dev server uses) in Allowed origins. The port must match exactly. http://localhost and http://127.0.0.1 are the only http:// forms accepted; everything else must be HTTPS. The entry counts toward your plan's origin limit, so on Free it takes your only slot.
12. FAQ
Does the widget work with third-party cookies disabled?
Yes. The visitor ID lives in first-party localStorage on your origin, never in a cookie. One caveat: Safari deletes a site's script-written storage, including localStorage, after seven days of Safari use without the visitor interacting with the site (WebKit: Full Third-Party Cookie Blocking and More). A Safari visitor who returns after that gap gets a new visitor ID, so dBel treats them as a new visitor.
Can I host the loader script myself?
No. The loader takes dBel's address from its own src URL. A copy served from your domain sends its requests to your domain, and they fail. Load it from https://dbel.ai/embed.js. If your site sends a Content-Security-Policy, allow https://dbel.ai in three directives: script-src (the loader), connect-src (the token request) and frame-src (the widget iframe).
Does this count against my minutes? Yes. Web sessions use the same minute allowance as phone calls. A web session has no phone number, so it adds no phone-number usage charge.
Can I record web sessions? Yes. Recording is controlled per-assistant under Recording. If you enable it, web sessions record the same way as phone calls. The pre-call recording disclosure (where you've configured one) plays at the start of every web call.
What about text chat / video / screen share? Voice only. The widget has no text chat, video or screen share.