Events
Generated reference for registered client events and their payloads.
Events
open-wa emits 17 events. Subscribe with the client helper (client.onMessage), the legacy listener name, or the event bus wildcard. Payload types are derived from each event's registered schema.
| Event | Legacy listener | Description | Payload | Status | License |
|---|---|---|---|---|---|
ack | onAck | Fired when a message acknowledgment is received | { id: MessageId; ack: "ACK_PENDING" | "ACK_SERVER" | "ACK_DEVICE" | "ACK_READ" | "ACK_PLAYED" | -1 | "ACK_ERROR" | 0 | 1 | 2 | 3 | 4 } | stable | - |
addedToGroup | onAddedToGroup | Fired when you are added to a group | { groupId: string; groupName: string; addedBy?: string } | stable | - |
anyMessage | onAnyMessage | Fired for any message including own messages | Message | stable | - |
callState | onCallState | Observed native call state, including unknown states. | { id: string; sessionId: string; generation: string; peer: string; state: string; direction: "incoming" | "outgoing"; video: boolean; terminal: boolean; observedAt: number | "Infinity" | "-Infinity" | "NaN"; endReason?: { code: string; message: string; source: "local" | "media" | "license" | "session" | "whatsapp" }; media?: { state: "attached" | "ended"; reason?: string } } | experimental | restricted |
chatState | onChatState | Fired when someone is typing or recording | { chatId: string; state: "typing" | "recording" | "paused"; senderId: string } | stable | - |
event | onEvent | A native event added or changed in the synced message store, including this account’s events. | WhatsAppEvent | beta | - |
eventResponse | onEventResponse | A decrypted RSVP added or changed in WhatsApp’s dedicated event-response collection. History loads may emit responses too; deduplicate by id and timestamp. | EventResponse | beta | - |
formResponse | onFormResponse | A form submission with question IDs and chosen option IDs | FormResponse | stable | insiders |
incomingCall | onIncomingCall | A native incoming call. The SDK hydrates its bound controls. | { id: string; sessionId: string; generation: string; peer: string; state: string; direction: "incoming" | "outgoing"; video: boolean; terminal: boolean; observedAt: number | "Infinity" | "-Infinity" | "NaN"; endReason?: { code: string; message: string; source: "local" | "media" | "license" | "session" | "whatsapp" }; media?: { state: "attached" | "ended"; reason?: string } } | experimental | restricted |
interactiveResponse | onInteractiveResponse | Structured reply, list, form or native interactive response | InteractiveResponse | stable | insiders |
logout | onLogout | Fired when the session is logged out | { reason?: string; timestamp: number } | stable | - |
message | onMessage | Fired when a new message is received (excluding own messages) | Message | stable | - |
messageDeleted | onMessageDeleted | Fired when a message is deleted | Message | stable | - |
participantsChanged | onParticipantsChanged | Fired when group participants change | { groupId: GroupId; action: "add" | "remove" | "promote" | "demote" | "invite" | "leave"; participantIds: ContactId[]; by?: string; who?: ContactId; chat?: GroupId | { _serialized: GroupId } } | stable | - |
pollVote | onPollVote | A decrypted poll vote added or changed in the synced store. Hydration can emit old votes. Hidden-voter polls omit sender and message identifiers. Deduplicate ordinary votes by id and timestamp; refresh getPollResults for current totals. | PollVote | beta | - |
reaction | onReaction | Fired when a reaction is added to a message | { messageId: string; reaction: string; senderId: string; timestamp: number } | stable | - |
stateChanged | onStateChanged | Fired when connection state changes | { state: "STARTING" | "AUTHENTICATING" | "READY" | "STOPPED" | "CONNECTED" | "DISCONNECTED" | "SYNCING" | "CONFLICT" | "UNLAUNCHED" | "PAIRING" | "TIMEOUT"; previousState?: "STARTING" | "AUTHENTICATING" | "READY" | "STOPPED" | "CONNECTED" | "DISCONNECTED" | "SYNCING" | "CONFLICT" | "UNLAUNCHED" | "PAIRING" | "TIMEOUT" } | stable | - |
Was this helpful?
Your answer includes the page path and docs version.
