Message

JavaScript Widget Message API

Quick DM

window.chatWidgetApi.chatToAddress(address, callback)
Method Name
Parameters
Return Values

window.chatWidgetApi.chatToAddress

address: Recipient's wallet address

callback: A callback event that returns true for success and false for failure

N/A

Quick public group chat

window.chatWidgetApi.joinPublicRoom(roomID, callback)
Name
Description
Parameters
Response

window.chatWidgetApi.joinPublicRoom

Automatically join group chat and display the group chat page.

roomId: room ID

callback(optional): function

N/A

Get the number of unread messages

window.chatWidgetApi.getUnreadCounts((num)=>{console.log(num)})
Method Name
Description
Parameters
Return Values

window.chatWidgetApi.getUnreadCounts

Get the number of unread messages

Callback function: (num)=>{console.log(num)}

N/A

Last updated