> ## Documentation Index
> Fetch the complete documentation index at: https://zapo.to/llms.txt
> Use this file to discover all available pages before exploring further.

# Presence & status

> Broadcast online presence, send typing and recording indicators, subscribe to contact presence, and post WhatsApp status updates with text and media.

## Own presence

Broadcast whether the account is online with `client.presence.send`:

```ts theme={null}
await client.presence.send('available')   // appears online
await client.presence.send('unavailable') // appears offline
```

<Note>
  The presence announced right after connecting is controlled by the [`markOnlineOnConnect`](/en/concepts/configuration#presence-on-connect) option.
</Note>

## Typing indicators (chat-state)

`sendChatstate` sends a per-chat hint such as typing or recording:

```ts theme={null}
// "typing…"
await client.presence.sendChatstate(jid, { state: 'composing' })

// "recording audio…"
await client.presence.sendChatstate(jid, { state: 'recording' })

// clear the indicator
await client.presence.sendChatstate(jid, { state: 'paused' })
```

A common pattern is to show typing briefly before replying:

```ts theme={null}
await client.presence.sendChatstate(jid, { state: 'composing' })
await new Promise((r) => setTimeout(r, 1200))
await client.message.send(jid, 'Done thinking!')
await client.presence.sendChatstate(jid, { state: 'paused' })
```

## Subscribing to a contact

To receive a contact's presence and chat-state, subscribe to them:

```ts theme={null}
await client.presence.subscribe(jid)

client.on('presence', (event) => {
  console.log(event.type, event.lastSeen)
})

client.on('chatstate', (event) => {
  console.log(event.state, 'from', event.participantJid)
})
```

<Warning>
  Subscriptions are **per-JID** and live only for the current connection. After a [reconnect](/en/guides/reconnection) you must re-subscribe to keep receiving updates.
</Warning>

## Status broadcasts

Post a status (the "stories" feature) with `client.status` ([`WaStatusCoordinator`](/en/reference/client#status)). The content is the same [content union](/en/guides/sending-messages#the-content-union) as a normal message; you provide the recipient list:

```ts theme={null}
const result = await client.status.send({
  content: 'Hello from my status!',
  recipients: ['5511999999999@s.whatsapp.net', '5511888888888@s.whatsapp.net']
})
```

Media works too:

```ts theme={null}
await client.status.send({
  content: { type: 'image', media: './story.jpg', mimetype: 'image/jpeg' },
  recipients
})
```

### Status privacy & mute

```ts theme={null}
// Who can see your status
await client.status.setPrivacy({ /* WaSetStatusPrivacyInput */ })

// Mute a contact's status
await client.status.setUserMuted(jid, true)

// Revoke a status you posted
await client.status.revokeStatus({ messageId, recipients })
```
