What problem does it solve?
Enable reliable real-time communication in Node.js backends by guiding the choice and configuration of WebSocket or Server-Sent Events, implementing authentication and input validation, and ensuring messages reach clients across multiple instances with reconnection and scaling strategies.
Core Features & Use Cases
- Socket.IO setup with authentication: middleware-based token verification, per-user rooms, and event handlers for messaging.
- SSE endpoints: simple server-to-client streams for notifications and live feeds with automatic reconnection and keep-alive.
- Rooms, namespaces & scaling: patterns for organizing channels, using Redis adapter for multi-instance broadcasting, and considerations for heavy payloads.
- Reconnection and reliability: client reconnection strategies, heartbeats, session handling, and common gotchas to avoid (validation, rate limiting, graceful cleanup).
- Use Case: implement a scalable chat and notification system that securely delivers messages to connected users across a cluster.
Quick Start
Use the real-time skill to implement a Node.js backend that uses Socket.IO with JWT authentication and a Redis adapter to support scaled chat and notification streams.