Skip to main content

Overview

Once the widget script has loaded, it exposes a small API on window.CallKaro. Use it to open the widget from your own buttons, close it programmatically, and run your own code when a conversation starts or ends. Nothing here is required. If you only want the launcher in the corner, the snippet on its own is enough.

Waiting For The Widget

The snippet uses defer, so window.CallKaro does not exist while your page is still parsing. Any code that touches it must wait. The simplest reliable approach is to check inside the handler that needs it, because by the time a visitor clicks something the widget has long since loaded:
If you need to run code as soon as the widget is available — to attach event listeners, for example — poll briefly:
Do not call CallKaro.open() on page load to auto-open the widget. It works, but opening a voice panel before a visitor has asked for it is intrusive, and some browsers will block the microphone prompt because it did not follow a user gesture. Trigger it from a click instead.

Methods

CallKaro.open()

Opens the conversation panel and hides the launcher. Does nothing if the panel is already open. Use it to trigger the widget from your own call-to-action:
Opening the panel does not start a conversation. The visitor still presses Talk and grants microphone permission themselves.

CallKaro.close()

Closes the panel and restores the launcher. Does nothing if it is already closed.
Closing the panel during an active conversation ends that conversation.

CallKaro.on(event, callback)

Registers a listener. Returns CallKaro, so calls can be chained:
You can register several listeners for the same event; all of them run. There is no way to remove a listener once added.
An error thrown inside your callback is caught and logged to the console — it will not break the widget.

CallKaro.widgetId

The widget id read from your script tag. Useful when the same analytics code runs on pages carrying different widgets.

Events

ready fires after the panel is opened for the first time, not on page load — the panel is only loaded when somebody opens it.

Examples

Track engagement in your analytics

Measure how long conversations last

Hide your own chat bubble while the widget is open

React

In React, register listeners once — for example in a top-level component. A listener added inside a component that mounts repeatedly will be registered again each time, and there is no way to remove it.

Limitations

Worth knowing before you build on this:
  • Listeners cannot be removed. There is no off() method.
  • No way to start a conversation from code. open() shows the panel; the visitor presses Talk. This is deliberate — browsers require a user gesture before granting microphone access.
  • No transcript access. The conversation text is not exposed to the host page. Read transcripts in Call History instead.
  • One widget per page. A second snippet on the same page is ignored, and CallKaro always refers to the first.

Need something else?

Tell us what you are trying to build and we will see what we can expose