WidgetCallbacksonCloseCopy pageonCloseTriggered when the widget is minimized/closed. onClose: function () { console.log("Widget closed");}Related articlesWidget callbacksWidget callbacks allow you to execute custom JavaScript code in response to specific events within the Positive User widget such as when it loads, opens, closes, or receives a message.Widget stateYou can programmatically control the visibility and state of the Positive User Chat Widget using the userengage function.Widget controlMethods to programmatically control the chat widget's visibility and state.