Socket Configuration

Everything makeWASocket({...}) accepts. The table is drawn from the package's own SocketConfig type โ€” options you won't find here don't exist.

The options that matter most

OptionTypeWhat it does
authAuthenticationStateRequired in practice. The session state โ€” from useMultiFileAuthState() or your own store
browser[string, string, string]The identity shown in Linked Devices, e.g. Browsers.ubuntu('Chrome'). Presets live on the exported Browsers object; Browsers.android was added in v1.0.4
loggerpino loggerSocket logging. Use pino({ level: 'silent' }) for production bots that don't need the firehose
version[number, number, number]The WhatsApp Web version to connect as. The package default tracks current WA โ€” v1.0.3 ships 2.3000.1035194821. Only override if you know why
getMessageasync (key) => message | undefinedRetry hook โ€” wire it to store.loadMessage (see Store) or recipients get "waiting for this message"
markOnlineOnConnectbooleanShow the account as "online" whenever the socket is connected. Set false for stealthier bots
syncFullHistorybooleanAsk the phone for the full chat history on pairing. false pairs much faster and is right for most bots
shouldSyncHistoryMessage(msg) => booleanFine-grained history control per sync type, when the boolean above is too coarse
shouldIgnoreJid(jid) => boolean | undefinedHard-ignore JIDs: no events fire for them and their messages aren't decrypted โ€” e.g. jid => jid === 'status@broadcast'

Timeouts, retries, keep-alive

OptionWhat it does
connectTimeoutMsFails the connection attempt if the socket can't connect within this interval
defaultQueryTimeoutMsDefault timeout for queries; undefined = no timeout
keepAliveIntervalMsWebSocket ping-pong interval that keeps the connection provably alive
qrTimeoutHow long to wait for the next QR to be generated (ms)
retryRequestDelayMsDelay between message retry requests
maxMsgRetryCountMaximum times a failed message is retried before giving up
msgRetryCounterCache / placeholderResendCacheCache stores backing the retry machinery โ€” supply persistent ones if retries must survive restarts

Media & link previews

OptionWhat it does
generateHighQualityLinkPreviewUploads a JPEG thumbnail to WhatsApp so link previews render richly โ€” costs an upload per link
linkPreviewImageThumbnailWidthWidth of generated link-preview thumbnails
mediaCacheA cache store for media, so identical media doesn't have to be re-uploaded
customUploadHostsOverride the media upload hosts
fetchAgent / agentHTTP agents for media fetch/upload and for the WebSocket โ€” the way to route through a proxy

Behaviour switches

OptionWhat it does
emitOwnEventsEmit events for actions performed by this socket itself
fireInitQueriesRun the initial queries automatically on connect (default behaviour); disable only for exotic flows
transactionOptsTransaction capability options for the Signal key store (max retries / timeout for key operations)
userDevicesCache / callOfferCacheCache stores for device lists and call offers
countryCodeAlphanumeric country code (e.g. 'US', 'ID') for the number in use
waWebSocketUrlThe WebSocket URL to connect to โ€” leave at the default unless testing

A production-shaped configuration

import makeWASocket, { Browsers, makeCacheableSignalKeyStore } from 'aunubaileys'
import pino from 'pino'

const logger = pino({ level: 'silent' })
const sock = makeWASocket({
  auth: {
    creds: state.creds,
    keys: makeCacheableSignalKeyStore(state.keys, logger)
  },
  logger,
  browser: Browsers.ubuntu('Chrome'),
  markOnlineOnConnect: false,
  syncFullHistory: false,
  getMessage: async (key) => (await store.loadMessage(key.remoteJid, key.id))?.message,
  shouldIgnoreJid: (jid) => jid === 'status@broadcast'
})
Deprecated, don't use: printQRInTerminal and mobile are marked deprecated/removed in the current config type. The QR still reaches you through connection.update โ€” render it yourself or use pairing codes.