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
| Option | Type | What it does |
auth | AuthenticationState | Required 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 |
logger | pino logger | Socket 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 |
getMessage | async (key) => message | undefined | Retry hook โ wire it to store.loadMessage (see Store) or recipients get "waiting for this message" |
markOnlineOnConnect | boolean | Show the account as "online" whenever the socket is connected. Set false for stealthier bots |
syncFullHistory | boolean | Ask the phone for the full chat history on pairing. false pairs much faster and is right for most bots |
shouldSyncHistoryMessage | (msg) => boolean | Fine-grained history control per sync type, when the boolean above is too coarse |
shouldIgnoreJid | (jid) => boolean | undefined | Hard-ignore JIDs: no events fire for them and their messages aren't decrypted โ e.g. jid => jid === 'status@broadcast' |
Timeouts, retries, keep-alive
| Option | What it does |
connectTimeoutMs | Fails the connection attempt if the socket can't connect within this interval |
defaultQueryTimeoutMs | Default timeout for queries; undefined = no timeout |
keepAliveIntervalMs | WebSocket ping-pong interval that keeps the connection provably alive |
qrTimeout | How long to wait for the next QR to be generated (ms) |
retryRequestDelayMs | Delay between message retry requests |
maxMsgRetryCount | Maximum times a failed message is retried before giving up |
msgRetryCounterCache / placeholderResendCache | Cache stores backing the retry machinery โ supply persistent ones if retries must survive restarts |
Media & link previews
| Option | What it does |
generateHighQualityLinkPreview | Uploads a JPEG thumbnail to WhatsApp so link previews render richly โ costs an upload per link |
linkPreviewImageThumbnailWidth | Width of generated link-preview thumbnails |
mediaCache | A cache store for media, so identical media doesn't have to be re-uploaded |
customUploadHosts | Override the media upload hosts |
fetchAgent / agent | HTTP agents for media fetch/upload and for the WebSocket โ the way to route through a proxy |
Behaviour switches
| Option | What it does |
emitOwnEvents | Emit events for actions performed by this socket itself |
fireInitQueries | Run the initial queries automatically on connect (default behaviour); disable only for exotic flows |
transactionOpts | Transaction capability options for the Signal key store (max retries / timeout for key operations) |
userDevicesCache / callOfferCache | Cache stores for device lists and call offers |
countryCode | Alphanumeric country code (e.g. 'US', 'ID') for the number in use |
waWebSocketUrl | The 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.