jidNormalizedUser
Normalizes a JID to use the standard WhatsApp server format.string | undefined
The JID to normalize
string
Normalized JID (converts ‘c.us’ to ‘s.whatsapp.net’)
- Before comparing JIDs
- When storing JIDs in databases
- To ensure consistent JID format across your application
jidDecode
Decodes a JID into its component parts.string | undefined
The JID to decode
FullJid | undefined
Object containing user, server, device, and domainType, or undefined if invalid
FullJid Type
- To extract the user ID from a JID
- To determine the server type
- To get device information from multi-device JIDs
jidEncode
Encodes JID components into a complete JID string.string | number | null
required
The user identifier
JidServer
required
Server type: ‘c.us’, ‘g.us’, ‘s.whatsapp.net’, ‘broadcast’, ‘lid’, etc.
number
Device ID for multi-device
number
Agent ID
string
Complete JID string
- To construct JIDs programmatically
- When building multi-device JIDs
- For creating group or broadcast JIDs
isJidGroup
Checks if a JID represents a group.string | undefined
The JID to check
boolean
True if the JID is a group (@g.us)
- To determine if a message is from a group
- Before performing group-specific operations
- For routing logic based on chat type
isJidBroadcast
Checks if a JID represents a broadcast list.string | undefined
The JID to check
boolean
True if the JID is a broadcast (@broadcast)
- To identify broadcast messages
- For handling status updates
- To filter broadcast-specific events
isJidStatusBroadcast
Checks if a JID is specifically the status broadcast.string
required
The JID to check
boolean
True if the JID is exactly ‘status@broadcast’
- To identify WhatsApp status messages
- For filtering status updates
- Different from regular broadcasts
isJidNewsletter
Checks if a JID represents a newsletter/channel.string | undefined
The JID to check
boolean
True if the JID is a newsletter (@newsletter)
- To identify newsletter/channel messages
- Before performing newsletter-specific operations
- Newsletter messages use different upload mechanisms
isLidUser
Checks if a JID is a LID (Linked ID) user.string | undefined
The JID to check
boolean
True if the JID ends with ‘@lid’
- To identify linked device users
- For handling privacy-focused identifiers
- LIDs are used for enhanced privacy in some regions
areJidsSameUser
Checks if two JIDs represent the same user (ignoring device ID).string | undefined
First JID to compare
string | undefined
Second JID to compare
boolean
True if both JIDs have the same user ID
- To compare users across different devices
- For deduplication
- When checking message participants