Skip to content

ChatroomSocket

ChatroomSocket contains methods to interact with the WebSocket in relation to chat.

Internally, Kient uses the Pusher channel chatrooms.${chatroomId}.v2.

Methods

async listen(chatroomId)

Listens to a specific chatroom and emits related events.

ParameterTypeRequiredDefaultDescription
chatroomIdstring | numbertrueThe ID of the chatroom to listen to

Returns

Promise<void>


async disconnect(chatroomId)

Disconnects from a specific chatroom.

ParameterTypeRequiredDefaultDescription
chatroomIdstring | numbertrueThe ID of the chatroom to disconnect from

Returns

Promise<void>