Skip to main content

Send Presence Update

Let contacts know whether you’re online, offline, typing, recording audio, or viewing their status.

Basic Usage

WAPresence Types

The presence parameter can be one of the following WAPresence values:
  • 'unavailable' - Offline/not available
  • 'available' - Online/available
  • 'composing' - Typing a message
  • 'recording' - Recording audio message
  • 'paused' - Stopped typing (treated as available)
The presence expires after about 10 seconds. You need to send periodic updates to maintain an active presence state.

Update Your Global Presence

To update your overall online/offline status:

Send Typing Indicator

Let the other person know you’re typing in their chat:

Send Recording Indicator

Show that you’re recording an audio message:
When using ‘composing’ or ‘recording’, always provide the jid parameter to specify which chat you’re active in.

Subscribe to Presence Updates

To receive presence updates from a contact or group:

Listen for Presence Updates

Receive notifications when contacts change their presence:

Push Notifications

If a desktop client is active, WA doesn’t send push notifications to the device. If you would like to receive said notifications — mark your Baileys client offline using sock.sendPresenceUpdate('unavailable')

Implementation Details

The sendPresenceUpdate function is implemented in src/Socket/chats.ts:684-724:
  • For available/unavailable: Sends a global presence update
  • For composing/recording/paused: Sends a chatstate update to specific JID
  • Automatically handles LID (Lightweight Identity) for supported users
  • Recording presence is sent as composing with media type ‘audio’
The function automatically replaces ’@’ symbols in your display name when sending presence updates.