SocketConfig: object
Defined in: src/Types/Socket.ts:33
Type declaration
agent?
proxy agentoptionalagent:Agent
appStateMacVerification
appStateMacVerification: object
verify app state MACs
appStateMacVerification.patch
patch: boolean
appStateMacVerification.snapshot
snapshot: boolean
auth
auth: AuthenticationState
provide an auth state object to maintain the auth state
browser
browser: WABrowserDescription
override browser config
cachedGroupMetadata()
cachedGroupMetadata: (cached group metadata, use to prevent redundant requests to WA & speed up msg sendingjid) =>Promise<GroupMetadata|undefined>
Parameters
jid
string
Returns
Promise<GroupMetadata | undefined>
callOfferCache?
cache to store call offersoptionalcallOfferCache:CacheStore
connectTimeoutMs
connectTimeoutMs: number
Fails the connection if the socket times out in this interval
countryCode
countryCode: string
alphanumeric country code (USA -> US) for the number used
customUploadHosts
customUploadHosts:custom upload hosts to upload media toMediaConnInfo["hosts"]
defaultQueryTimeoutMs
defaultQueryTimeoutMs:Default timeout for queries, undefined for no timeoutnumber|undefined
emitOwnEvents
emitOwnEvents: boolean
should events be emitted for actions done by this socket connection
enableAutoSessionRecreation
enableAutoSessionRecreation: boolean
Enable automatic session recreation for failed messages
enableRecentMessageCache
enableRecentMessageCache: boolean
Enable recent message caching for retry handling
fetchAgent?
agent used for fetch requests — uploading/downloading mediaoptionalfetchAgent:Agent
fireInitQueries
fireInitQueries: boolean
Should baileys fire init queries automatically, default true
generateHighQualityLinkPreview
generateHighQualityLinkPreview: boolean
generate a high quality link preview,
entails uploading the jpegThumbnail to WA
getMessage()
getMessage: (fetch a message from your store implement this so that messages failed to send (solves the “this message can take a while” issue) can be retriedkey) =>Promise<IMessage|undefined>
Parameters
key
WAMessageKey
Returns
Promise<IMessage | undefined>
keepAliveIntervalMs
keepAliveIntervalMs: number
ping-pong interval for WS connection
linkPreviewImageThumbnailWidth
linkPreviewImageThumbnailWidth: number
width for link preview images
logger
logger: ILogger
logger
makeSignalRepository()
makeSignalRepository: (auth,logger,pnToLIDFunc?) =>SignalRepositoryWithLIDStore
Parameters
auth
SignalAuthState
logger
ILogger
pnToLIDFunc?
(jids) => Promise<LIDMapping[] | undefined>
Returns
SignalRepositoryWithLIDStore
markOnlineOnConnect
markOnlineOnConnect: boolean
marks the client as online whenever the socket successfully connects
maxMsgRetryCount
maxMsgRetryCount: number
max retry count
mediaCache?
provide a cache to store media, so does not have to be re-uploadedoptionalmediaCache:CacheStore
mobile?
should baileys use the mobile api instead of the multi device apioptionalmobile:boolean
Deprecated
This feature has been removedmsgRetryCounterCache?
map to store the retry counts for failed messages; used to determine whether to retry a message or notoptionalmsgRetryCounterCache:CacheStore
options
options: RequestInit
options for HTTP fetch requests
patchMessageBeforeSending()
patchMessageBeforeSending: (Optionally patch the message before sending outmsg,recipientJids?) =>Promise<PatchedMessageWithRecipientJID[] |PatchedMessageWithRecipientJID> |PatchedMessageWithRecipientJID[] |PatchedMessageWithRecipientJID
Parameters
msg
IMessage
recipientJids?
string[]
Returns
Promise<PatchedMessageWithRecipientJID[] | PatchedMessageWithRecipientJID> | PatchedMessageWithRecipientJID[] | PatchedMessageWithRecipientJID
placeholderResendCache?
cache to track placeholder resendsoptionalplaceholderResendCache:CacheStore
printQRInTerminal?
should the QR be printed in the terminaloptionalprintQRInTerminal:boolean
Deprecated
This feature has been removedpushName?
Initial pushName carried in the registration ClientPayload (used by mock servers for deterministic phone assignment).optionalpushName:string
qrTimeout?
time to wait for the generation of the next QR in msoptionalqrTimeout:number
retryRequestDelayMs
retryRequestDelayMs: number
time to wait between sending new retry requests
shouldIgnoreJid()
shouldIgnoreJid: (Returns if a jid should be ignored, no event for that jid will be triggered. Messages from that jid will also not be decryptedjid) =>boolean|undefined
Parameters
jid
string
Returns
boolean | undefined
shouldSyncHistoryMessage()
shouldSyncHistoryMessage: (manage history processing with this control; by default will sync up everythingmsg) =>boolean
Parameters
msg
IHistorySyncNotification
Returns
boolean
syncFullHistory
syncFullHistory: boolean
Should Baileys ask the phone for full history, will be received async
transactionOpts
transactionOpts: TransactionCapabilityOptions
transaction capability options for SignalKeyStore
userDevicesCache?
provide a cache to store a user’s device listoptionaluserDevicesCache:PossiblyExtendedCacheStore
version
version: WAVersion
version to connect with
waWebSocketUrl
waWebSocketUrl:the WS url to connect to WAstring|URL