The RofimWidgetHTMLElement API allows a developer to interact and manage the Sana from his web application.
This object has methods and emits event that the web application can listen to.
show()
Displays the chat widget.
When in LIGHTBOX mode, displays the fold/unfold button
hide()
Hides the chat widget.
When in LIGHTBOX mode, hides the fold/unfold button
toggleVisibility()
Toggles between showing and hiding the widget.
Returns
Returns true if visible, false otherwise
deployLightbox()
Deploys the widget in LIGHTBOX mode.
Throws
Thows an error if the widget is not in LIGHTBOX mode
foldLightbox()
Folds the widget in LIGHTBOX mode.
Throws
Thows an error if the widget is not in LIGHTBOX mode
asyncgetUnreadMessagesNumber()
Returns the number of unread messages.
Returns
Number of unread message
asyncmarkAllAsRead()
Marks all messages as read.
Returns
asyncsendMessage()
Sends a message in a room
Parameters
roomId where to send the message
Message to send
Returns
asyncsendFileMessage()
Sends a file in a room
Parameters
securityToken obtained from the UploadCallback
File to send
Returns
asynccreateRoom()
Creates a new room
Parameters
Room creation request
Returns
Returns a Room object
asynclogout()
The user is logged out.
The Sana Widget is removed from the DOM
