Call2MeStart free
Channels

Widgets: embed a chat widget in one line of JavaScript

Drop a single script tag and your voice agent becomes a chat widget on every page — same prompt, same knowledge base, same brand.

Updated May 1, 2026

The widget is the same voice agent talking through a browser instead of a phone. One line of JavaScript embedded on every page.

The 30-second setup

  1. Dashboard → Widgets → New Widget.
  2. Pick which agent it should use (your existing voice agent is fine).
  3. Customize colors, position, greeting.
  4. Copy the snippet:
<script src="https://api.call2me.app/v1/widgets/widget_xxxxx/embed.js" async></script>
  1. Paste before </body> on your site. Done.

What customization options are available

Set in the dashboard, or via PATCH /v1/widgets/{id}:

  • position — bottom-right (default) or bottom-left.
  • primary_color — hex code; used for the bubble and message background.
  • greeting_message — first thing shown when opened.
  • auto_open and auto_open_delay_ms — open automatically after a delay.
  • allowed_domains — restrict the widget to your own sites.

Not supported: office hours, hide-on-mobile, URL include/exclude rules and open-on-scroll. The embed script reads its settings from the widget record only; a window.call2meConfig object before the script has no effect.

How pricing works

$0.01 per message. A message = one user input plus the agent's reply (one pair).

VolumeCost
100 conversations × 6 messages$6
1,000 conversations × 8 messages$80
10,000 conversations × 10 messages$1,000

For most sites, the widget cost is rounding-error in the marketing budget.

Same agent, two channels

The killer feature: the widget reuses your voice agent. Same:

  • System prompt — personality and rules identical.
  • Knowledge base — answers come from the same chunks.
  • Post-call extraction — same structured fields captured (works on chat too).
  • Webhooks — same downstream system gets the data.
  • Multilingual stack — chat answers in the visitor's language; voice follows the agent language.

You don't maintain two separate agents.

Voice mode: talk to the widget

The widget can also hold a live, two-way voice conversation in the browser (WebRTC, no phone number needed). Set voice_mode on the widget:

voice_modeWhat the visitor sees
chat (default)Text chat only
voiceVoice button only
bothText chat plus a microphone button
curl -X PATCH https://api.call2me.app/v1/widgets/widget_xxxxx \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"voice_mode": "both", "voice_session_limit_sec": 300}'

Voice minutes are billed to you, the widget owner, at the normal per-minute rate, so the platform caps exposure:

  • Per session: voice_session_limit_sec (default 300 s) — the session ends at the limit.
  • Per widget per day: 10 visitor voice sessions by default; the 11th gets 429 Daily voice limit reached.
  • Per visitor: 5 voice sessions per IP per day.
  • Balance: at $0 the voice button returns 402 and chat keeps working.
  • Origin: set allowed_domains; voice sessions from other sites get 403. With an empty list the widget is open to any site — set it before turning voice on.

Asymmetries between voice and chat

  • Chat can show clickable buttons, links, formatted text. Voice can't.
  • Voice hears tone. Chat doesn't.
  • Voice replies are usually 1 sentence (long monologues are bad on the phone). Chat can be longer.

A small conditional in the system prompt covers it:

If the user is on a voice call, keep replies concise (1-2 sentences).
If the user is on chat (no audio context), you can be slightly more
detailed and use bullet points where helpful.

When the widget should NOT replace humans

  • Account-specific issues that need DB lookups your widget isn't wired for.
  • Refunds, credits, escalations — let the agent acknowledge and escalate.
  • Anything legally consequential — escalate to a human.

The escalation path: webhook fires when the agent says it can't help, your team picks up the conversation. Transcript travels with the handoff.

Multiple widgets on one page

Some sites want different agents on different pages — e.g. a sales bot on /pricing and a support bot on /help. You can:

  • Create multiple widgets, each pointing to a different agent.
  • Embed the right one per page based on URL.

API reference

If you'd rather skip the dashboard widget builder and embed via the API directly:

  • GET /v1/widgets/{widget_id}/embed.js — public, returns the runtime JS.
  • GET /v1/widgets/{widget_id}/config — public, widget config.
  • POST /v1/widgets/{widget_id}/chat — public, send a message, get a reply.
  • GET /v1/widgets/{widget_id}/preview — public, preview the widget standalone.

See API Reference for the full schema.

Frequently asked

Q.How do I embed a Call2Me chat widget on my site?

Create a widget in the dashboard, copy the one-line script tag, paste it before </body> on your site. Done.

Q.What does the chat widget cost?

$0.01 per message. Each user message + agent reply pair counts as one message. Conservative estimate: 1,000 conversations of ~8 messages = ~$80.

Q.Can the chat widget use the same agent as my phone calls?

Yes. Widgets reuse the same voice agent — same system prompt, same knowledge base, same post-call data extraction. One personality, two channels.

Q.Can I customize the widget's appearance?

Yes. Set primary color, position (bottom-right/left), welcome message, auto-open delay, and per-page show/hide rules. Fully brandable.

ShareX / TwitterLinkedIn

Ready to ship?

Spin up your first agent in 5 minutes — $5 free credit.

An interpreter or a voice agent, billed by the minute.

Start with free credit and no card. You pay only while a call is running.