Skip to main content
The Socket.io client provides real-time, bidirectional communication between the client and server. It automatically listens to service events and supports all standard service methods.

Installation

Browser Usage

1

Include the libraries

2

Connect to the server

3

Configure Socket.io client

4

Use services with real-time events

Node.js Usage

Service Methods

All standard Feathers service methods work over Socket.io:

Real-time Events

The Socket.io client automatically listens to service events. When any service method is called (by any client or the server), all connected clients receive the corresponding event:

Event Listener Management

Manage event listeners using standard EventEmitter methods:

EventTarget Compatibility

The client also supports the EventTarget API:

Socket.io Connection Options

You can configure the Socket.io connection with various options:

Connection Events

Listen to Socket.io connection events:

Custom Methods

Socket.io client supports custom service methods:

Direct Service Usage

You can create service instances without configuring the app:

Error Handling

Handle errors from Socket.io service calls:

Accessing the Socket Instance

The socket instance is available on the app:

TypeScript Support

The Socket.io client has full TypeScript support:

React Example

Using Socket.io client in a React application:

Next Steps

REST Client

Learn about HTTP-based connections

Authentication

Add authentication to your Socket.io client