client.Events.SubscribeAsync to receive realtime events from an instance.
Common events
| Event | When it happens |
|---|---|
Message | New incoming or outgoing message. |
ReadReceipt | Read status update. |
Presence | User presence. |
HistorySync | History synchronization. |
ChatPresence | Conversation presence. |
Connected | Instance connected. |
Disconnected | Instance disconnected. |
GroupParticipantsAdd | Participant added to a group. |
GroupParticipantsRemove | Participant removed from a group. |
All | Handler for every event. |
Subscribe to realtime
EventSubscription — object with on(), close(), and automatic reconnect when configured.
Register handlers
Close subscription
Promise<void> after the WebSocket closes.
Use await using to ensure clean shutdown when the scope ends.
Event envelope
Delivery and ack
The SDK sends ack after handlers complete. Delivery is at-least-once; deduplicate byevt.Id when handlers have side effects.

