The basic method for starting the widget by calling the closer.init method with the orgId parameter can be extended with additional attributes:
apiKey - enables opening the widget from the client's apiKey, thanks to which we can restore his session. The value is UUID, e.g. "00000000-0000-0000-0000-000000000000"
onOpen - triggers the function given as an attribute every time the widget is opened.
onClose - triggers the function given as an attribute each time the widget is closed.
onMessageSent - triggers the function given as an attribute every time the client sends a message.
Use the closer.deinit method to log off the client securely. It accepts no arguments. It removes the client's data from the browser and removes the widget from the DOM. After calling this method, we can use closer.init again.