Skip to main content

Overview

WuKongIM Web EasySDK is a lightweight JavaScript SDK that enables you to add real-time chat functionality to your web application in just 5 minutes. This guide will take you through the complete process from installation to sending your first message.
System Requirements: Supports modern browsers (Chrome 60+, Firefox 55+, Safari 11+, Edge 79+)

Step 1: Install SDK

Choose any of the following methods to install EasyJSSDK:

Step 2: Basic Integration

2.1 Import SDK

2.2 Initialize SDK

2.3 Listen for Messages

2.4 Remove Event Listeners

In some cases, you may need to remove event listeners to avoid memory leaks or duplicate processing. EasyJSSDK provides the off method to remove event listeners.
Important Reminder: Both eventName and callback parameters are required for the off method. The callback reference must be exactly the same as the one used when adding the listener with on().

Syntax

Parameter Description:
  • eventName (Event): The event name to remove the listener for (required)
  • callback (EventHandler): The specific callback function to remove (required)

Correct Usage

Incorrect Usage

Practical Application Example

Framework Integration Best Practices

React Example:
Vue Example:
Source Code Reference: You can check the EasyJSSDK source code to understand the specific implementation details of the off method.

2.5 Connect to Server

2.6 Send Messages

Complete Example Code

View complete example code and more feature demonstrations

Complete Protocol Documentation

View WuKongIM’s complete protocol documentation

GitHub Repository

Visit EasyJSSDK’s GitHub repository

Issue Feedback

Report issues or provide suggestions