Skip to content

ChannelSocket

ChatroomSocket contains methods to interact with the WebSocket in relation to channel events.

Internally, Kient uses the Pusher channel channel.${channelId}.

Methods

async listen(channelId)

Listens to a specific channel and emits related events.

ParameterTypeRequiredDefaultDescription
channelIdstring | numbertrueThe ID of the channel to listen to

Returns

Promise<void>


async disconnect(channelId)

Disconnects from a specific channel.

ParameterTypeRequiredDefaultDescription
channelIdstring | numbertrueThe ID of the channel to disconnect from

Returns

Promise<void>