Documentation Index
Fetch the complete documentation index at: https://mintlify.com/whiskeysockets/baileys/llms.txt
Use this file to discover all available pages before exploring further.
UserFacingSocketConfig
The configuration object passed tomakeWASocket.
auth are optional and will use default values from DEFAULT_CONNECTION_CONFIG.
Required Configuration
Authentication state object containing credentials and keys. Use
useMultiFileAuthState or useSingleFileAuthState to create this.Connection Configuration
The WebSocket URL to connect to WhatsApp Web.
Connection timeout in milliseconds. Connection fails if socket doesn’t open within this time.
Ping-pong interval for WebSocket connection in milliseconds.
Default timeout for queries in milliseconds. Set to
undefined for no timeout.HTTPS proxy agent for the WebSocket connection.
Agent used for fetch requests when uploading/downloading media. Separate from the WebSocket agent.
Client Identification
WhatsApp Web version to use. Format:
[major, minor, patch].Browser description sent to WhatsApp. Format:
[device, manufacturer, version].Logging
Logger instance for debugging. Must implement
trace, debug, info, warn, error, and fatal methods.Behavior Configuration
Whether to emit events for actions performed by this socket connection.
Automatically mark the client as online when the socket successfully connects.
Automatically fire initialization queries on connection. Set to
false if you want manual control.Whether Baileys should ask the phone for full message history (received asynchronously).
Alphanumeric country code for the phone number being used (e.g., ‘US’, ‘GB’, ‘IN’).
Message Handling
getMessage
(key: WAMessageKey) => Promise<proto.IMessage | undefined>
default:"async () => undefined"
Fetch a message from your store. Implement this to enable message retries for failed sends.
Control which history sync messages to process. Default skips FULL sync type.
Return
true to ignore events and messages from specific JIDs. Messages from ignored JIDs won’t be decrypted.Media Configuration
Custom upload hosts for media uploads.
Width for link preview thumbnail images in pixels.
Generate high quality link previews by uploading the jpegThumbnail to WhatsApp.
Options for HTTP fetch requests (headers, etc.).
Retry & Error Handling
Time to wait between sending new retry requests in milliseconds.
Maximum retry count for failed messages.
Enable automatic session recreation for failed messages.
Enable recent message caching for retry handling.
Caching
Cache to store media files to avoid re-uploading.
Cache to store retry counts for failed messages.
Cache to store user device lists. Can optionally support batch operations:
Cache to store call offers.
Cache to track placeholder resend requests.
Advanced Configuration
Time to wait for QR code generation in milliseconds.
Transaction options for SignalKeyStore operations.
Verify app state MACs for security.
cachedGroupMetadata
(jid: string) => Promise<GroupMetadata | undefined>
default:"async () => undefined"
Provide cached group metadata to prevent redundant requests and speed up message sending.
Deprecated Options
Deprecated. This feature has been removed. Previously used to switch between mobile and multi-device API.
Deprecated. This feature has been removed. Use the
connection.update event to handle QR codes.