In-App Chat
JavaScript API
We expose some functions in the Frontend to programmtically control the Chat window.
window.Pylon(“show”)
Opens the chat window. Useful for programmatically triggering the chat window from an explicit support flow or button on your site.
window.Pylon(“hide”)
Closes the chat window.
window.Pylon(“onChangeUnreadMessagesCount”)
Pass in a callback function that is called when the unread message count changes. If you pass in null
as the callback function, the existing callback is removed.
window.Pylon("onChangeUnreadMessagesCount", function(unreadCount) {
console.log("unread changed!", unreadCount)
});