PostgreSQL-based adapter for Socket.IO enabling horizontal scaling by broadcasting and emitting events across multiple Socket.IO instances. Version 1.2.1 is the latest stable release, with infrequent updates (no recent commits). Unlike Redis-based adapters, it uses PostgreSQL's LISTEN/NOTIFY for pub/sub, making it suitable for teams already running PostgreSQL. Supports remote join, leave, and disconnect across nodes.
npm install socket.io-adapter-postgresNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connects Socket.IO to PostgreSQL for multi-process broadcasting using the postgres adapter.
Grant the user the ability to execute LISTEN/NOTIFY, or use a superuser for development.
Use the 'pg' package and ensure pubClient is a Pool, subClient is a Client.
Consider using socket.io-redis or a maintained adapter for Socket.IO v4+ compatibility.
Limit the number of Socket.IO instances or use Redis for high-throughput scenarios.
Ensure PostgreSQL is running on the specified port, or change the port in the adapter options.
Upgrade Socket.IO to version 1.0 or later.
Increase max connections in PostgreSQL configuration or limit pool size in adapter options (not directly supported).