Show UserFacingSocketConfig properties
auth
AuthenticationState
required
Authentication state object to maintain the auth state. Use useMultiFileAuthState() to create this.
version
WAVersion
default: "[2, 3000, 1033846690]"
WhatsApp Web version to connect with. Array of three numbers [major, minor, patch].
browser
WABrowserDescription
default: "Browsers.macOS('Chrome')"
Browser description as a tuple [OS, Browser, Version]. Use the Browsers constant for predefined configurations.
waWebSocketUrl
string | URL
default: "'wss://web.whatsapp.com/ws/chat'"
The WebSocket URL to connect to WhatsApp.
Timeout in milliseconds for the connection. Fails the connection if the socket times out.
defaultQueryTimeoutMs
number | undefined
default: "60000"
Default timeout for queries in milliseconds. Set to undefined for no timeout.
Ping-pong interval for WebSocket connection in milliseconds.
logger
ILogger
default: "logger.child({ class: 'baileys' })"
Logger instance for debugging and logging.
HTTPS proxy agent for the WebSocket connection.
Agent used for fetch requests when uploading/downloading media.
Whether events should be emitted for actions done by this socket connection.
customUploadHosts
MediaConnInfo['hosts']
default: "[]"
Custom upload hosts to upload media to.
Time to wait between sending new retry requests in milliseconds.
Maximum retry count for failed messages.
Time to wait for the generation of the next QR code in milliseconds.
shouldSyncHistoryMessage
(msg: proto.Message.IHistorySyncNotification) => boolean
Function to manage history processing. Default syncs everything except FULL sync type.
transactionOpts
TransactionCapabilityOptions
Transaction capability options for SignalKeyStore.
Marks the client as online whenever the socket successfully connects.
Alphanumeric country code (e.g., USA -> US) for the number used.
Cache to store media, so it doesn’t have to be re-uploaded.
Map to store retry counts for failed messages; used to determine whether to retry a message.
userDevicesCache
PossiblyExtendedCacheStore
Cache to store a user’s device list.
Cache to store call offers.
Cache to track placeholder resends.
linkPreviewImageThumbnailWidth
Width for link preview images in pixels.
Whether Baileys should ask the phone for full history (received async).
Whether Baileys should fire init queries automatically.
generateHighQualityLinkPreview
Generate high quality link preview by uploading the jpegThumbnail to WhatsApp.
enableAutoSessionRecreation
Enable automatic session recreation for failed messages.
Enable recent message caching for retry handling.
shouldIgnoreJid
(jid: string) => boolean | undefined
default: "() => false"
Function that returns if a JID should be ignored. No event for that JID will be triggered and messages from that JID will not be decrypted.
patchMessageBeforeSending
Function
default: "msg => msg"
Optionally patch the message before sending out. ( msg : proto . IMessage , recipientJids ?: string []) =>
Promise < PatchedMessageWithRecipientJID [] | PatchedMessageWithRecipientJID > |
PatchedMessageWithRecipientJID [] | PatchedMessageWithRecipientJID
appStateMacVerification
object
default: "{ patch: false, snapshot: false }"
Options for HTTP fetch requests.
getMessage
(key: WAMessageKey) => Promise<proto.IMessage | undefined>
default: "async () => undefined"
Fetch a message from your store. Implement this so that messages that failed to send can be retried. Solves the “this message can take a while” issue.
cachedGroupMetadata
(jid: string) => Promise<GroupMetadata | undefined>
default: "async () => undefined"
Cached group metadata function to prevent redundant requests to WhatsApp and speed up message sending.
makeSignalRepository
Function
default: "makeLibSignalRepository"
Function to create signal repository. ( auth : SignalAuthState , logger : ILogger ,
pnToLIDFunc ?: ( jids : string []) => Promise < LIDMapping [] | undefined >) =>
SignalRepositoryWithLIDStore