SocketConfig
Complete configuration object formakeWASocket().
Connection Settings
The WebSocket URL to connect to WhatsApp serversDefault:
'wss://web.whatsapp.com/ws/chat'Connection timeout in milliseconds. Fails if socket doesn’t connect within this time.Default:
20000 (20 seconds)Default timeout for queries in milliseconds.
undefined for no timeout.Default: 60000 (60 seconds)Ping-pong interval for WebSocket connection in millisecondsDefault:
25000 (25 seconds)Proxy agent for WebSocket connection
Agent used for HTTP fetch requests (uploading/downloading media)
Client Identification
WhatsApp Web version to connect withType:
[number, number, number]Example: [2, 2323, 4]Browser identification sent to WhatsAppType:
[string, string, string]Example: ['Baileys', 'Chrome', '1.0.0']Alphanumeric country code for the number (e.g., ‘US’, ‘BR’, ‘IN’)
Authentication
Authentication state object containing credentials and keysSee AuthenticationState
Options for SignalKeyStore transaction capability
Logging and Events
Logger instance for debug output
Whether to emit events for actions done by this socket connectionDefault:
trueHistory and Sync
Whether to ask the phone for full history (received asynchronously)Default:
falseControl which history messages to syncReturn
true to sync, false to skipWhether to automatically fire initialization queriesDefault:
trueMessage Handling
Fetch a message from your store for retry logicRequired for handling “this message can take a while” issues
Optionally modify messages before sending
Determine if a JID should be ignored (no events, no decryption)
Media
Custom upload hosts for media
Width for link preview images in pixelsDefault:
192Generate high quality link previews (uploads jpegThumbnail to WhatsApp)Default:
falseRetry and Error Handling
Time to wait between sending retry requests in millisecondsDefault:
250Maximum retry count for messagesDefault:
5Time to wait for QR code generation in millisecondsDefault:
60000 (60 seconds)Enable automatic session recreation for failed messagesDefault:
falseEnable recent message caching for retry handlingDefault:
falseCaching
Cache to store media to avoid re-uploadingSee CacheStore
Cache to track retry counts for failed messages
Cache to store user device lists
Cache to store call offers
Cache to track placeholder resends
Fetch cached group metadata to speed up message sending
Advanced
Mark client as online when socket connectsDefault:
trueVerify app state MACs
Options for HTTP fetch requests
Factory function for creating signal repositories
CacheStore
Interface for cache implementations used throughout Baileys.Get a cached key
Set a key in the cache
Delete a key from the cache
Flush all data from cache
PossiblyExtendedCacheStore
Extended cache store with batch operations:Get multiple keys at once
Set multiple keys at once
Delete multiple keys at once