RevoplyAIDocs
Website widget

Widget events

The events the website widget raises in your page, what each one carries, and how to listen for them.

The widget tells your page what happens in the chat, for your analytics or your own UI. These are browser events on the visitor's page, not webhooks: they reach only that page, and only while it is open.

const off = RevoplyAI.on('first_message', () => {
  analytics.track('chat_started');
});

// later
off();
EventWhenHandler receives
openThe panel opensNothing
closeThe panel closesNothing
first_messageThe visitor sends the first message of a conversationNothing
message_sentThe visitor sends a messageNothing
reply_receivedReplies arrive in the panel{ count }, the number of new replies
handoff_requestedThe visitor asks for a personNothing
conversation_endedThe visitor ends the conversationNothing
feedbackThe visitor rates an answer{ helpful }, true or false
errorThe panel hit an error{ message, … }, for your logs
  • Subscribe after embed.js has loaded; on() cannot be queued.
  • A handler that throws is logged to the console and does not stop the others.
  • New events may be added. Events you do not subscribe to cost nothing.

To act on conversations on your server (store them, open a ticket), use the message.received and conversation.handover webhooks instead: they are signed and do not depend on the visitor's browser.