socket.io
to emit real-time events, leveraging WebSocket technology. This makes integration development more efficient and straightforward for developers. WebSocket provides a full-duplex communication channel over a single, long-lasting connection, enabling real-time data flow between the client and the server.
WEBSOCKET_ENABLED
environment variable to true
. See more details in Environment Variables.WEBSOCKET_GLOBAL_EVENTS
environment variable must be set to true
. In this mode, the WebSocket is initialized when the service starts and sends events from all instances, regardless of channels. This means that any client connected to the WebSocket will receive global events, covering all Evolution API instances configured in the system.
.env
file:
/instance_name
in the URL. The connection URL will simply be:
set
command on the instance. This allows the WebSocket to be specific to each instance, and real-time communication is restricted to that instance.
WEBSOCKET_GLOBAL_EVENTS
is set to false
or not configured, and follow the traditional instance setup flow.
/instance_name
in the URL:
api.yoursite.com
with your API’s actual domain and instance_name
with your specific instance name.
event_name
with the specific event you want to listen to.
disconnect
method: