Prosody
Web Widget

Install the web widget

Attach an agent created in the Console as a bottom-corner widget on your website. Keep only the public identifier in the browser and keep sensitive API keys on the server.

Allowed domains

Restrict the domains that can display the widget in the Console.

Server proxy

Widget-specific APIs use a public widget key; private API keys never belong in the browser.

Events

Subscribe to open, close, agent-message, and human-handoff events.

Install code

Use only the pk_widget_... public key issued on the Console web-widget page. Agent, theme, copy, and allowed-domain settings are loaded from the server configuration associated with that key.

<script
  src="https://console.humelo.com/agent-widget.js"
  data-public-key="pk_widget_xxxxxxxxxxxxxxxx"
  async
></script>

Client events

window.ProsodyAgent?.open?.();

window.ProsodyAgent?.on?.("conversation.opened", (event) => {
  console.log(event.sessionId);
});

window.ProsodyAgent?.on?.("agent.message", (event) => {
  console.log(event.content);
});

window.ProsodyAgent?.on?.("handoff.created", (event) => {
  console.log(event.conversationId);
});

window.ProsodyAgent?.on?.("conversation.closed", (event) => {
  console.log(event.reason);
});

The public widget does not currently emit tool-call events such as tool.called. Contact us to scope an enterprise integration if you need tool-execution history.