Live Chat Visitor Badge
  • 14 Jul 2022
  • 1 Minute to read
  • Dark
    Light

Live Chat Visitor Badge

  • Dark
    Light

Article summary

The widget appears as an icon beside the visitor avatar in the live chat tab.

Example manifest:

{
  "manifestVersion": "2.0",
  "agentConsole": {
    "widgets": {
      "visitorBadge": {
        "id": "custom-icon",
        "url": "./index.html",
        "tooltip": "Custom Icon",
        "icon": "./icon.png"
      }
    }
  }
}

See more introduction.

The following additional actions are available in this widget:

How to Use API

You must invoke api through SDK, which provides different methods, such as listening to events using the on method. Which method is used to call the api? It it desided by the providor.

Learn more for SDK view here.

Actions

  1. Update the visitor badge widget

Params:

NameTypeDescription
isEnabledboolDefault value is true, if the value is true, the custom icon is available.
isHiddenboolDefault value is false, if the value is true, the custom icon is hidden.

Return: No.

Example:

const client = APPClient.init();
client
  .set("agentconsole.livechat.visitorBadges.icon", {
    isEnabled: true,
    isHidden: false,
  })

Events

  1. Register click event callback

Params:

NameTypeDescription
callbackfunctionThe callback function will be fired when clicking the extended badge.

Return: No.

Example:

const client = APPClient.init();
client.on(
  "agentconsole.livechat.visitorBadges.icon.click",
  function (badge) {
    // do stuff
  }
);

Was this article helpful?