Skip to main content
A WebCall instance controls one widget and one call at a time. With the script tag, the instance is window.Callers.widget; in code, it is the object you create with new WebCall(config).

Call control

call()

Starts a voice call and opens the call window. Resolves once the call is dialing; listen to onCallStarted for the moment it connects. Errors are reported through onError and in the call window, not by rejecting.
  • Call it from a user gesture (a click handler) so the browser allows the microphone and audio.
  • Pass captchaToken only when you solve Cloudflare Turnstile yourself. See Bot protection.
  • Calling it while a call is already connecting does nothing.

hangup()

Ends the active call. The built-in window then shows the post-call review with the transcript. Does nothing when no call is active.

disconnect()

Tears down the current call and its transcript, cancels a call that is still connecting, and returns the widget to the collapsed launcher. The instance stays usable; call call() again to start over.

destroy()

Ends any call, closes the transcript stream, and removes the widget from the page. Use it when your component unmounts. The instance can’t be used afterwards.

Microphone and speaker

These do nothing when there is no active call, or when the state already matches.

Text input

sendInput()

Sends a typed message to the agent during an active call, voice or text. Up to 2,000 characters.
  • To answer an in-call form, pass the form message’s id as widgetMessageId and the answer as content (the built-in UI sends a JSON string of the field values).
  • Throws sendInput requires an active call when no call is connected. To start a text conversation, see Text and voice.
  • Rejects with Failed to send input: ... if the API refuses the message.

Widget visibility

Theme

setTheme()

Replaces the theme immediately, including during a call. Once you call it, your theme stays in effect for this instance even over the agent’s dashboard theme. See Theming.

Transcript

getTranscriptMessages()

Returns a copy of the current call’s transcript (the most recent 500 messages). Returns an empty array before a call and after it ends; use onCallEnded with onTranscriptChanged if you need to keep the final transcript.

connectTranscriptStream() / disconnectTranscriptStream()

Opens or closes the live transcript stream manually. The SDK manages the stream for you; you only need these when you set no transcript callback and want to open the stream later. connectTranscriptStream() throws connectTranscriptStream requires an active call without a connected call.

Other

Exports

The CallersWebSdk global (and the package) export:

Events and transcript

Callbacks and message shapes.

Try methods in the playground

Open Developer > SDK methods to call each method on a live widget.