Debug Dashboard Overview

This dashboard provides real-time debugging and monitoring tools for Webex Connect (IMI Chat) chatbot widgets. Use it to inspect widget communication, troubleshoot issues, and understand how your chatbot interacts with web pages.

Dashboard Layout

The dashboard is organized into four main areas:

  • Left Sidebar - Widget status, session info, filters, and widget configuration details
  • Console Logs - Captures all JavaScript console output from the page
  • PostMessages - Shows cross-origin communication between the widget iframe and parent page
  • Network & Events - Tracks HTTP requests and widget lifecycle events

Tip: The right 25% of the screen is reserved for the chatbot widget. You can interact with the chatbot while viewing debug information.

Quick Start

  1. Open this page - the widget loads automatically
  2. Watch the PostMessages panel for widget initialization
  3. Look for loadstyles action to confirm config received
  4. Use Full Report to export all debug data

Dashboard Tools

Each panel and button in the dashboard serves a specific debugging purpose.

Sidebar Controls

Reload Widget

Removes the current widget instance and reinitializes it. Useful for testing initialization sequences or recovering from errors. Clears the widget iframe and reloads the IMI Chat script.

🗑 Clear

Clears all logged data from every panel. Use this to start fresh when debugging a specific interaction sequence.

💾 Export

Downloads all captured logs as a JSON file. The export includes session info, widget config, and all panel data with timestamps.

Quick Actions

🔍 Inspect

Logs current widget state to the Events panel. Shows: DOM presence of widget elements, iframe count, IMI objects, and whether config has been received.

📡 Ping

Tests connectivity to IMI servers by sending a HEAD request to media.imi.chat. Reports latency in milliseconds or connection failure.

📋 Full Report

Copies a comprehensive JSON report to clipboard. Includes environment info, widget config, and filtered logs (noise removed). Perfect for sharing with support teams.

Copy Config

Copies just the widget configuration JSON. Only available after the loadstyles PostMessage is received.

Filter Controls

Located in the sidebar, these checkboxes control what appears in the PostMessages panel:

  • Hide React DevTools noise - Filters out browser extension messages
  • Hide debug_panel test msgs - Filters dashboard's own test messages
  • Collapse repeated messages - Groups identical consecutive messages with a count badge

Panel Features

Each debug panel includes:

  • Counter badge - Shows number of logged entries
  • Copy button - Copies all panel entries as JSON
  • Per-entry copy - Hover over any entry to reveal its copy button
  • Color coding - Boolean values show green (true) or red (false)
  • Source tags - WIDGET, BROWSER, or DEBUG labels on PostMessages

IMI Chat Widget SDK Methods

The Webex Engage LiveChat widget exposes JavaScript SDK methods to control its behavior. These methods are available on the global imichatwidget object.

imichatwidget.show()

Displays the chat widget. Use this when you've hidden the widget by default and want to show it programmatically (e.g., on button click).

// Show the widget when user clicks a button
document.getElementById('chatBtn').onclick = function() {
    imichatwidget.show();
};

imichatwidget.hide()

Hides the chat widget from view. The widget remains loaded but invisible.

imichatwidget.hide();

imichatwidget.init(data, callback)

Initializes the widget with custom data. Pass custom chat fields that will be attached to all conversations.

var data = JSON.stringify({
    "custom_chat_fields": {
        "Customer ID": "12345",
        "Plan Type": "Premium"
    }
});

imichatwidget.init(data, function(response) {
    console.log('Widget initialized', response);
});

Note: Custom field keys must be configured in the Webex Engage Admin Console before use. Unknown keys are silently ignored.

imichatwidget.update(data, callback)

Updates custom chat fields after initialization. Behaves similarly to init().

var data = JSON.stringify({
    "custom_chat_fields": {
        "Page": "checkout",
        "Cart Value": "$150"
    }
});

imichatwidget.update(data, function(response) {
    console.log('Fields updated');
});

imichatwidget.on(event, callback)

Subscribe to widget events. The most common event is imichat-widget:ready.

imichatwidget.on("imichat-widget:ready", function(appId) {
    console.log('Widget ready, App ID:', appId);
    // Safe to call other methods now
    imichatwidget.show();
    imichatwidget.maximizeWindow();
});

imichatwidget.maximizeWindow()

Expands the chat widget to its maximized state (full chat view).

imichatwidget.minimizeWindow()

Minimizes the chat widget to its collapsed state (just the launcher button).

Complete Example

<!-- Widget container (hidden by default) -->
<div id="divicw"
     data-bind="YOUR-BIND-ID"
     data-guid="YOUR-GUID"
     style="display:none;"></div>

<!-- Custom chat button -->
<button id="openChat">Need Help?</button>

<script>
// Wait for widget to be ready
imichatwidget.on("imichat-widget:ready", function(appId) {
    // Initialize with customer data
    var customerData = JSON.stringify({
        "custom_chat_fields": {
            "User ID": getUserId(),
            "Page": window.location.pathname
        }
    });

    imichatwidget.init(customerData, function() {
        // Enable the chat button
        document.getElementById('openChat').disabled = false;
    });
});

// Open chat on button click
document.getElementById('openChat').onclick = function() {
    imichatwidget.show();
    imichatwidget.maximizeWindow();
};
</script>

<!-- Load widget script -->
<script src="https://media.imi.chat/widget/js/imichatinit.js"></script>

Widget Configuration

Widget configuration is received via PostMessage with the loadstyles action. This dashboard parses and displays key settings in the sidebar.

Configuration Fields

Field Description
appid Unique application identifier for this widget instance
name Display name configured for the widget
website_id ID of the website this widget is registered for
agent_avail Whether live agents are currently available (1 = yes, 0 = no)
enable_proactive Whether proactive chat invitations are enabled
isattachmentenabled Whether file attachments are allowed in chat
isemojienable Whether emoji picker is available
widget_lang Language code for widget UI text
widgetcolor Primary color theme (hex code)

Installation Requirements

To install the widget on your website:

  1. Obtain your widget credentials from Webex Engage Admin Console
  2. Add the widget container div with your data-bind and data-guid values
  3. Include the IMI Chat initialization script
  4. Whitelist your domain in the Admin Console (without http/https prefix)
<!-- Widget container -->
<div id="divicw"
     data-bind="YOUR-BIND-ID"
     data-guid="YOUR-WIDGET-GUID"></div>

<!-- Widget script (add before closing body tag) -->
<script src="https://media.imi.chat/widget/js/imichatinit.js"></script>

Domain Whitelisting

Configure your domain in General Settings using patterns like:

  • *.example.com - All subdomains
  • www.example.com - Specific subdomain
  • example.com - Root domain only

Important: Do not include http:// or https:// in the domain configuration.

24/7 Availability

To make the widget available outside business hours:

  1. Go to Admin Console > LiveChat Channel settings
  2. Enable "Suppress working hours and agent presence checks"
  3. The widget will now be available regardless of agent availability

Troubleshooting Guide

Common issues and their solutions when working with the Webex Connect widget.

Widget Not Appearing

Check the Console Logs panel for errors

  • 404 on imichatinit.js - Verify the script URL is correct and accessible
  • CORS errors - Your domain may not be whitelisted in Admin Console
  • No errors but no widget - Check if divicw element exists with correct attributes

Check the PostMessages panel

  • No messages from imi.chat - Script may not have loaded successfully
  • loadstyles not received - Widget failed to initialize; check GUID and bind ID

Tip: Use the Ping button to verify connectivity to IMI servers.

Widget Loads But Chat Fails

  • agent_avail = 0 - No agents are online; check team schedules
  • Connection timeout - Check Network panel for failed WebSocket connections
  • Blank chat window - May indicate bot configuration issue; check Webex Connect flows

Custom Fields Not Working

  • Verify field names match exactly (case-sensitive) with Admin Console configuration
  • Call init() or update() after imichat-widget:ready event
  • Ensure data is properly JSON stringified

Performance Issues

  • Slow load - Add cache-busting parameter sparingly; remove for production
  • Memory issues - Avoid repeatedly calling init without page refresh
  • Duplicate widgets - Check for multiple script inclusions

Debug Checklist

  1. Is divicw present with correct data-bind and data-guid?
  2. Is the script tag loading from media.imi.chat?
  3. Does the domain match whitelist configuration?
  4. Are there any JavaScript errors in console?
  5. Is loadstyles PostMessage received?
  6. What does agent_avail show in config?
  7. Can you ping the IMI servers successfully?

PostMessage Communication

The widget communicates with the parent page using the browser's postMessage API. This dashboard intercepts and displays these messages for debugging.

Message Structure

Widget messages typically contain:

{
    "action": "actionName",
    "message": "...",
    "key": "...",
    "value": "..."
}

Common Actions

Action Description
loadstyles Widget configuration payload (JSON in message field)
setlocal Widget storing data in localStorage (key/value)
getlocal Widget retrieving data from localStorage
resize Widget requesting size change
maximize Widget expanding to full view
minimize Widget collapsing to launcher

Message Origins

Messages come from different sources:

  • media.imi.chat - Official widget messages (tagged as WIDGET)
  • Browser extensions - React DevTools, Redux tools, etc. (tagged as BROWSER)
  • Same origin - Your own page or this debug panel (tagged as DEBUG)

Fingerprint Tracking

The widget generates a unique fingerprint for visitor tracking. Look for setlocal action with key: "fingerprint" to see this value. It's used to maintain conversation continuity across sessions.

Filtering Noise

Browser extensions often flood postMessage with their own communications. This dashboard automatically filters:

  • React DevTools "hello" messages
  • Redux DevTools communications
  • Messages from chrome-extension:// or moz-extension://

Toggle filters in the sidebar to show or hide these messages.

Common Issues Reference

Error: Widget GUID Not Found

Cause: The data-guid attribute doesn't match any registered widget.

Solution: Verify the GUID in Webex Engage Admin Console under LiveChat assets.

Error: Domain Not Whitelisted

Cause: The current page's domain isn't in the allowed list.

Solution: Add your domain pattern to the widget's allowed domains in Admin Console.

Error: Cross-Origin Frame Access Denied

Cause: Normal security behavior - you cannot directly access iframe content.

Solution: This is expected. Use PostMessage API for communication.

Warning: IMIchat is undefined

Cause: Trying to call widget methods before script loads.

Solution: Wait for imichat-widget:ready event before calling methods.

Issue: Chat History Not Showing

Cause: Conversation history may be disabled or fingerprint changed.

Solution: Check Admin Console settings and verify localStorage isn't being cleared.

Issue: Bot Not Responding

Possible causes:

  • Flow not published in Webex Connect
  • Bot integration webhook URL incorrect
  • Error in bot flow logic
  • Service account permissions

Debug: Check Webex Connect flow debugger and webhook logs.

WebSocket & MQTT Monitoring

The WebSocket and MQTT panels provide real-time monitoring of connection activity. However, there are important limitations to understand.

Cross-Origin Iframe Limitation

The Webex Connect/IMI chat widget runs inside a cross-origin iframe from media.imi.chat. Due to browser security restrictions, WidgetScope cannot intercept WebSocket or MQTT traffic that occurs inside this iframe.

This means:

  • Actual chat message content is not visible in the WebSocket/MQTT panels
  • Connection open/close events inside the iframe cannot be captured
  • The panels will show "widget-iframe (cross-origin)" as the connection source

What CAN Be Monitored

WidgetScope detects widget activity through indirect signals:

  • Widget initialization - Detected via the loadstyles PostMessage
  • Storage operations - When the widget stores/retrieves data via PostMessage
  • Same-origin WebSockets - Any WebSocket connections made by your own page (not the widget iframe)

To See Actual WebSocket Traffic

Use your browser's built-in Developer Tools:

  1. Open DevTools (F12 or Cmd+Option+I)
  2. Go to the Network tab
  3. Click the WS filter button
  4. Start a chat conversation
  5. Click on any WebSocket connection to see messages

Tip: In Safari, enable the Develop menu (Preferences → Advanced → Show Develop menu) to access DevTools.

Why This Limitation Exists

Browser security prevents JavaScript on one domain from accessing resources (including WebSocket connections) created by an iframe from a different domain. This is the Same-Origin Policy - a fundamental web security feature.

The IMI widget intentionally runs in a cross-origin iframe to:

  • Protect chat message privacy
  • Isolate widget code from the host page
  • Prevent tampering with chat sessions

Requesting Enhanced Events

If you need client-side access to chat events (message sent, message received, etc.), you can request this feature from Webex:

Currently, the widget only exposes the imichat-widget:ready event to the parent page.

External Resources

Downloads complete documentation as a markdown file

Official documentation and community resources for Webex Connect development.

Official Documentation

SDK Reference Pages

Community & Support

Testing Tools

  • Glitch.com - Recommended for testing widgets without a live site

Need help? Contact your customer success representative or email developers@webex.com

📝 Console Logs
0
📩 PostMessages
0
🔌 WebSocket
0
Active: 0 Total: 0 0 0 0
📡 MQTT
-
Not detected
Conn: 0 Pub: 0 Recv: 0 Sub: 0
🌐 Network
0
Widget Events
0
💻 Browser Console
0
Copied to clipboard!

Configure WidgetScope

Enter your Webex Connect widget credentials

Widget Credentials
Webex Engage → Assets → Channel Assets → LiveChat → Edit → Installation
The data-guid value
The data-bind value
Displayed in sidebar
Required Configuration

⚠ Whitelist This Domain

1. Webex Engage: Add widgetscope.vercel.app to your LiveChat asset's Websites tab.

2. Webex Connect Flow: Add domain to Custom Variables:
Services → [Service] → Flows → [Flow] → Edit → Settings → Custom Variables → liveChatDomain

Need Help?

View official setup guide →

Not an official Cisco/Webex product. Questions? chris@klopconsulting.com