# What changed in socket.io-client

> 18 changes in socket.io-client 2 to 4 from its official release notes, upgrade guides and advisories: 4 breaking, 8 new APIs and options. Each one cited. Sources checked 2026-10-23. HTML: https://unstale.sh/npm/socket.io-client/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## socket.io-client 4

### New APIs and options

- Export ExtendedError so it can be used in TypeScript with the connect_error event. (4.8.4) — [release notes](https://github.com/socketio/socket.io/releases/tag/socket.io-client%404.8.4)
- Export the reserved event interfaces for use in TypeScript. (4.8.4) — [release notes](https://github.com/socketio/socket.io/releases/tag/socket.io-client%404.8.4)
- Support for typed events was added, allowing developers to use event types with the client. (4.0.0) — [release notes](https://github.com/socketio/socket.io/releases/tag/4.0.0)
- Some utility methods were added to the client API. (4.0.0) — [release notes](https://github.com/socketio/socket.io/releases/tag/4.0.0)

### Fixes and other changes

- A client bump is required for minor server-side bug fixes. (4.8.3) — [release notes](https://github.com/socketio/socket.io/releases/tag/socket.io-client%404.8.3)
- The queue is drained before the connect event is emitted. (4.8.2) — [release notes](https://github.com/socketio/socket.io/releases/tag/socket.io-client%404.8.2)
- The bundle no longer mangles the _placeholder attribute. (4.8.2) — [release notes](https://github.com/socketio/socket.io/releases/tag/socket.io-client%404.8.2)

## socket.io-client 3

### Breaking changes

- Connecting to a namespace no longer implicitly connects to the default namespace. (3.0.0) — [release notes](https://github.com/socketio/socket.io/releases/tag/3.0.0)
- Using reserved event names now throws. (3.0.0) — [release notes](https://github.com/socketio/socket.io/releases/tag/3.0.0)

### New APIs and options

- An ES6 module export is available. (3.0.0) — [release notes](https://github.com/socketio/socket.io/releases/tag/3.0.0)
- A msgpack bundle is served for use by developers. (3.0.0) — [release notes](https://github.com/socketio/socket.io/releases/tag/3.0.0)
- Catch-all listeners are supported, letting a socket listen for all events. (3.0.0) — [release notes](https://github.com/socketio/socket.io/releases/tag/3.0.0)

### Behavior and default changes

- The Engine.IO id is no longer reused. (3.0.0) — [release notes](https://github.com/socketio/socket.io/releases/tag/3.0.0)

## socket.io-client 2

### Breaking changes

- For self-signed certificates, rejectUnauthorized now defaults to true. (2.0.0) — [release notes](https://github.com/socketio/socket.io/releases/tag/2.0.0)
- A breaking change related to utf-8 encoding in engine.io-parser makes this release not backward-compatible. (2.0.0) — [release notes](https://github.com/socketio/socket.io/releases/tag/2.0.0)

### New APIs and options

- Applications can provide a custom parser according to their needs. (2.0.0) — [release notes](https://github.com/socketio/socket.io/releases/tag/2.0.0)

### Performance

- The handshake packets were merged, reducing the number of roundtrips needed to establish a connection. (2.0.0) — [release notes](https://github.com/socketio/socket.io/releases/tag/2.0.0)

### Fixes and other changes

- The client socket id now matches the id on the server side. (2.0.0) — [release notes](https://github.com/socketio/socket.io/releases/tag/2.0.0)
