Skip to main content
Presence in WhatsApp describes what another user is currently doing: whether they are online, typing a message, recording an audio clip, or have gone inactive. Baileys lets you both subscribe to presence updates from other contacts and broadcast your own presence to them.

Presence states

Subscribe to presence updates

Call presenceSubscribe with a chat JID to request that WhatsApp start sending you presence notifications for that chat. You then listen for the presence.update event to receive the data.

Full subscribe and listen pattern

Assuming sock was created elsewhere via makeWASocket(...):
The event payload has the shape:
For group chats, presences is a map of individual participant JIDs to their presence data. For one-on-one chats, it will contain a single entry for the contact.

Broadcast your own presence

Use sendPresenceUpdate to tell WhatsApp what you are currently doing. You can optionally scope it to a specific chat JID; omitting jid broadcasts to all open subscriptions.
The available WAPresence values are:
Presence updates expire after approximately 10 seconds. If you want to sustain a composing indicator, you must call sendPresenceUpdate repeatedly.

Receiving push notifications on the phone

When your Baileys client is marked as available, WhatsApp treats it as an active desktop session and suppresses push notifications to the paired phone. If you want the phone to keep receiving push notifications, mark your client as offline on connect:
Alternatively, explicitly send an unavailable presence after connecting: