Skip to main content

Fetch privacy settings

Retrieve your current privacy settings.
const privacySettings = await sock.fetchPrivacySettings(true)
console.log('privacy settings: ' + privacySettings)
force
boolean
default:"false"
Force refresh settings from server instead of using cached values

Last seen privacy

Control who can see when you were last online.
const value = 'all' // 'contacts' | 'contact_blacklist' | 'none'
await sock.updateLastSeenPrivacy(value)
value
WAPrivacyValue
required
Privacy level:
  • all - Everyone can see your last seen
  • contacts - Only your contacts can see
  • contact_blacklist - All contacts except blocked ones
  • none - Nobody can see your last seen

Online privacy

Control who can see when you’re online.
const value = 'all' // 'match_last_seen'
await sock.updateOnlinePrivacy(value)
value
WAPrivacyOnlineValue
required
Privacy level:
  • all - Everyone can see when you’re online
  • match_last_seen - Same as your last seen privacy setting

Profile picture privacy

Control who can see your profile picture.
const value = 'all' // 'contacts' | 'contact_blacklist' | 'none'
await sock.updateProfilePicturePrivacy(value)
value
WAPrivacyValue
required
Privacy level:
  • all - Everyone can see your profile picture
  • contacts - Only your contacts can see
  • contact_blacklist - All contacts except blocked ones
  • none - Nobody can see your profile picture

Status privacy

Control who can see your status updates.
const value = 'all' // 'contacts' | 'contact_blacklist' | 'none'
await sock.updateStatusPrivacy(value)
value
WAPrivacyValue
required
Privacy level:
  • all - Everyone can see your status
  • contacts - Only your contacts can see
  • contact_blacklist - All contacts except blocked ones
  • none - Nobody can see your status

Read receipts privacy

Control whether to send read receipts (blue checkmarks).
const value = 'all' // 'none'
await sock.updateReadReceiptsPrivacy(value)
value
WAReadReceiptsValue
required
Privacy level:
  • all - Send read receipts
  • none - Don’t send read receipts
If you disable read receipts, you also won’t be able to see when others read your messages.

Groups add privacy

Control who can add you to groups.
const value = 'all' // 'contacts' | 'contact_blacklist'
await sock.updateGroupsAddPrivacy(value)
value
WAPrivacyGroupAddValue
required
Privacy level:
  • all - Everyone can add you to groups
  • contacts - Only your contacts can add you
  • contact_blacklist - All contacts except blocked ones can add you

Default disappearing mode

Set the default timer for disappearing messages in new chats.
const ephemeral = 86400
await sock.updateDefaultDisappearingMode(ephemeral)
duration
number
required
Duration in seconds for messages to disappear:
  • 0 - Disable (messages don’t disappear)
  • 86400 - 24 hours
  • 604800 - 7 days
  • 7776000 - 90 days
TimeSeconds
Remove0
24h86,400
7d604,800
90d7,776,000

Block user

Block a user to prevent them from messaging you.
await sock.updateBlockStatus(jid, 'block') // Block user
jid
string
required
The JID of the user to block
action
'block' | 'unblock'
required
Action to perform:
  • block - Block the user
  • unblock - Unblock the user

Unblock user

Unblock a previously blocked user.
await sock.updateBlockStatus(jid, 'unblock') // Unblock user

Fetch blocklist

Retrieve the list of all blocked users.
const response = await sock.fetchBlocklist()
console.log(response)
Returns an array of JIDs for all blocked users.

Build docs developers (and LLMs) love