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:- npm
- yarn
- CDN
Step 2: Basic Integration
2.1 Import SDK
- ES6 Modules
- CommonJS
- CDN (Global Variables)
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 theoff 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
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:2.5 Connect to Server
2.6 Send Messages
Related Resources
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

