Skip to Content
← Back to all demos

Action Links

Embedded action links in AI responses for live agent escalation, WalkMe flows, and custom client-side actions

Custom protocol handlersLive agent escalationWalkMe integrationParameter parsinglinkClick events

How It Works

The widget supports custom protocol links in markdown content. When an AI response includes a link with a non-standard protocol (anything other than http:, https:, mailto:, tel:), the widget:

  1. Prevents default browser navigation (no about:blank errors)
  2. Parses parameters from the URL
  3. Emits a linkClick event with parsed data
  4. Invokes the matching custom protocol handler if registered

Supported Syntax

AI responses can include markdown links with custom protocols:

Markdown SyntaxParsed Result
[Speak to Agent](action:escalate-to-agent)protocol: "action:", params: { value: "escalate-to-agent" }
[Contact Support](livechat:department=billing&priority=high)protocol: "livechat:", params: { department: "billing", priority: "high" }
[Show tutorial](walkme:flowId=12345)protocol: "walkme:", params: { flowId: "12345" }

Parameter Formats

  • Key-value: protocol:key=value&key2=value2 { key: "value", key2: "value2" }
  • Simple value: protocol:value { value: "value" }

Integration Code

const widget = window.NexusChatWidget.init({
  experienceId: "your-experience-id",
  apiUrl: "undefined",

  advanced: {
    customProtocolHandlers: {
      // Handle action: protocol for generic actions
      "action:": (params, event) => {
        if (params.value === "escalate-to-agent") {
          // Trigger live agent handover
          openLiveAgentChat({
            sessionId: event.sessionId,
            source: "ai-response"
          });
        }
      },

      // Handle livechat: protocol with parameters
      "livechat:": (params, event) => {
        openLiveAgentChat({
          department: params.department,
          priority: params.priority || "normal",
          sessionId: event.sessionId
        });
      },

      // Handle walkme: protocol for tutorials
      "walkme:": (params, event) => {
        if (window.WalkMeAPI && params.flowId) {
          window.WalkMeAPI.startFlowById(parseInt(params.flowId));
        }
      }
    }
  }
});

// Track all link clicks for analytics
widget.on("linkClick", (data) => {
  console.log("Link clicked:", data);
  analytics.track("link_click", {
    protocol: data.protocol,
    action: data.params.value,
    linkText: data.text
  });
});

Use Cases

  • Live Agent Escalation: Let users click a link in the AI response to connect with a human agent
  • WalkMe Integration: Launch guided tutorials or product tours from AI responses
  • In-App Navigation: Deep link to specific app features or screens
  • Custom Actions: Trigger any client-side behavior (open modals, submit forms, etc.)
  • Analytics: Track link clicks via the linkClick event

Event Monitor

Click the action links in the widget to see events appear here:

Events will appear here...