npm / socket.io-client
socket.io-client
What changed in socket.io-client 2 to 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-23.
4 breaking8 new APIs and options1 performance1 behavior and defaults4 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initsocket.io-client 47 changes
New APIs and options 4
Export ExtendedError so it can be used in TypeScript with the connect_error event.
Export the reserved event interfaces for use in TypeScript.
Support for typed events was added, allowing developers to use event types with the client.
Some utility methods were added to the client API.
Fixes and other changes 3
A client bump is required for minor server-side bug fixes.
The queue is drained before the connect event is emitted.
The bundle no longer mangles the _placeholder attribute.
socket.io-client 36 changes
Breaking changes 2
Connecting to a namespace no longer implicitly connects to the default namespace.
Using reserved event names now throws.
New APIs and options 3
An ES6 module export is available.
A msgpack bundle is served for use by developers.
Catch-all listeners are supported, letting a socket listen for all events.
Behavior and default changes 1
The Engine.IO id is no longer reused.
socket.io-client 25 changes
Breaking changes 2
For self-signed certificates, rejectUnauthorized now defaults to true.
A breaking change related to utf-8 encoding in engine.io-parser makes this release not backward-compatible.
New APIs and options 1
Applications can provide a custom parser according to their needs.
Performance 1
The handshake packets were merged, reducing the number of roundtrips needed to establish a connection.
Fixes and other changes 1
The client socket id now matches the id on the server side.