Quick Reference for AI Agents & Developers
Advanced Capabilities
Connection Status
Monitor WebSocket connection state and handle network changes gracefully
Manual WebSocket Management
Take full control of WebSocket connections for advanced use cases
Real-Time Listeners
Comprehensive guide to all event listeners available in the SDK
Login Listener
Handle authentication state changes and session management
When to Use Advanced Features
| Feature | Use Case | Benefit |
|---|---|---|
| Connection Status | Mobile apps, unstable networks | Graceful offline handling |
| Manual WebSocket | Background apps, battery optimization | Resource efficiency |
| Real-Time Listeners | Custom UI updates, analytics | Full event control |
| Login Listener | Multi-device sync, security | Session management |
Connection Management
Understanding connection states is crucial for production applications:- JavaScript
- TypeScript
Best Practices
Always Handle Disconnections
Always Handle Disconnections
Implement reconnection logic and offline indicators to maintain good UX during network issues.
Clean Up Listeners
Clean Up Listeners
Remove listeners when components unmount to prevent memory leaks.
Use Manual WebSocket for Background Apps
Use Manual WebSocket for Background Apps
Disconnect WebSocket when app goes to background to save battery and resources.