/ SDKs / JavaScript
SDKs
Chat SDKs JavaScript v4
Chat SDKs JavaScript
Chat SDKs
JavaScript
Version 4

Event handler

Copy link

Sendbird's Chat SDK for JavaScript provides three types of event handlers for client apps: channel event handler, user event handler, and connection event handler. Through the channel event handler and user event handler, the Sendbird server notifies client apps in the foreground for events that are happening in relation to channels and users. Through the connection event handler, the Sendbird server detects changes in the connection status of a client app. When the client app is disconnected from the server, the SDK tries to reconnect to the server and notifies the client app of the result through the connection event handler.

The Chat SDK communicates with our server through persistent WebSocket connections and multi-thread processing, receiving callbacks of asynchronous channel, user, and connection events through handlers in real-time. This interaction enables you to track the events you desire and implement your own chat features associated with those events.

Note: Sendbird Chat SDK v4 supports both TypeScript and JavaScript.


Functionalities by event handlers

Copy link

The following is a list of event handler functionalities that our Chat SDK provides.

Managing a channel event handler

Copy link
FunctionalityDescriptionOpen channelGroup channel

Add or remove a channel event handler

Adds or removes an event handler that receives information about events happening in channels from the Sendbird server.

Managing a user event handler

Copy link
FunctionalityDescriptionOpen channelGroup channel

Add or remove a user event handler

Adds or removes an event handler that receives information about events related to users connected to the Sendbird server.

Managing a connection event handler

Copy link
FunctionalityDescriptionOpen channelGroup channel

Add or remove a connection event handler

Adds or removes an event handler that receives information about changes related to the Sendbird server connection status.