Skip to main content

Interface: ClientOptions

Defined in: client/options.ts:8

Properties

authStrategy?

optional authStrategy?: AuthStrategy

Defined in: client/options.ts:10

Auth/persistence strategy. Defaults to LocalAuth in .whatsweb_auth.


autoReconnect?

optional autoReconnect?: boolean

Defined in: client/options.ts:22

Automatically reconnect if the connection drops. Defaults to true.


commandPrefix?

optional commandPrefix?: string | string[]

Defined in: client/options.ts:40

Command prefix(es) for the router. Defaults to ['!', '/'].


deviceName?

optional deviceName?: string

Defined in: client/options.ts:30

Device name shown in "Linked devices". Defaults to whatsweb.


history?

optional history?: false | { limit?: number; maxChats?: number; }

Defined in: client/options.ts:50

In-memory per-chat message history (used by conversation.history()). Defaults to { limit: 50, maxChats: 1000 }. Set to false to disable.


logger?

optional logger?: Logger

Defined in: client/options.ts:52

Pino (or compatible) logger. Silent by default.


markOnlineOnConnect?

optional markOnlineOnConnect?: boolean

Defined in: client/options.ts:32

Mark the account as "online" on connect. Defaults to false.


maxReconnectAttempts?

optional maxReconnectAttempts?: number

Defined in: client/options.ts:24

Max reconnection attempts before giving up. Defaults to Infinity.


pairingCode?

optional pairingCode?: string

Defined in: client/options.ts:20

Phone number (E.164, with or without +) to link via pairing code instead of QR. Ideal when you can't scan a QR.


printQRInTerminal?

optional printQRInTerminal?: boolean

Defined in: client/options.ts:28

Print the QR / code to the terminal automatically. Defaults to true.


rateLimitMs?

optional rateLimitMs?: number

Defined in: client/options.ts:38

Minimum milliseconds between outgoing messages. When set, all sends go through a serial queue spaced by this interval, reducing ban risk. Defaults to undefined (send immediately).


reconnectDelayMs?

optional reconnectDelayMs?: number

Defined in: client/options.ts:26

Base delay (ms) for the exponential reconnection backoff. Defaults to 1000.


session?

optional session?: string

Defined in: client/options.ts:15

Shortcut: session name. Stored in .whatsweb_auth/<session>. Handy for keeping several accounts. For full control, pass authStrategy.


stateStore?

optional stateStore?: StateStore

Defined in: client/options.ts:45

Per-chat conversation state store. Defaults to an in-memory store; implement StateStore to back it with Redis, a database, etc.