Event handler
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
andJavaScript
.
Functionalities by event handlers
The following is a list of event handler functionalities that our Chat SDK provides.
Managing a channel event handler
Functionality | Description | Open channel | Group channel |
---|---|---|---|
Adds or removes an event handler that receives information about events happening in channels from the Sendbird server. |
Managing a user event handler
Functionality | Description | Open channel | Group channel |
---|---|---|---|
Adds or removes an event handler that receives information about events related to users connected to the Sendbird server. |
Managing a connection event handler
Functionality | Description | Open channel | Group channel |
---|---|---|---|
Adds or removes an event handler that receives information about changes related to the Sendbird server connection status. |