Type alias SocketConfig

SocketConfig: {
    agent?: Agent;
    appStateMacVerification: {
        patch: boolean;
        snapshot: boolean;
    };
    auth: AuthenticationState;
    browser: WABrowserDescription;
    callOfferCache?: CacheStore;
    connectTimeoutMs: number;
    customUploadHosts: MediaConnInfo["hosts"];
    defaultQueryTimeoutMs: number | undefined;
    emitOwnEvents: boolean;
    fetchAgent?: Agent;
    fireInitQueries: boolean;
    generateHighQualityLinkPreview: boolean;
    getMessage: ((key) => Promise<IMessage | undefined>);
    keepAliveIntervalMs: number;
    linkPreviewImageThumbnailWidth: number;
    logger: Logger;
    makeSignalRepository: ((auth) => SignalRepository);
    markOnlineOnConnect: boolean;
    mediaCache?: CacheStore;
    mobile?: boolean;
    msgRetryCounterCache?: CacheStore;
    options: AxiosRequestConfig<{}>;
    patchMessageBeforeSending: ((msg, recipientJids) => Promise<IMessage> | IMessage);
    printQRInTerminal: boolean;
    qrTimeout?: number;
    retryRequestDelayMs: number;
    shouldIgnoreJid: ((jid) => boolean | undefined);
    shouldSyncHistoryMessage: ((msg) => boolean);
    socket?: any;
    syncFullHistory: boolean;
    transactionOpts: TransactionCapabilityOptions;
    userDevicesCache?: CacheStore;
    version: WAVersion;
    waWebSocketUrl: string | URL;
}

Type declaration

  • Optional agent?: Agent

    proxy agent

  • appStateMacVerification: {
        patch: boolean;
        snapshot: boolean;
    }

    verify app state MACs

    • patch: boolean
    • snapshot: boolean
  • auth: AuthenticationState

    provide an auth state object to maintain the auth state

  • browser: WABrowserDescription

    override browser config

  • Optional callOfferCache?: CacheStore

    cache to store call offers

  • connectTimeoutMs: number

    Fails the connection if the socket times out in this interval

  • customUploadHosts: MediaConnInfo["hosts"]

    custom upload hosts to upload media to

  • defaultQueryTimeoutMs: number | undefined

    Default timeout for queries, undefined for no timeout

  • emitOwnEvents: boolean

    should events be emitted for actions done by this socket connection

  • Optional fetchAgent?: Agent

    agent used for fetch requests -- uploading/downloading media

  • fireInitQueries: boolean

    Should baileys fire init queries automatically, default true

  • generateHighQualityLinkPreview: boolean

    generate a high quality link preview, entails uploading the jpegThumbnail to WA

  • getMessage: ((key) => Promise<IMessage | undefined>)
      • (key): Promise<IMessage | undefined>
      • 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 retried

        Parameters

        Returns Promise<IMessage | undefined>

  • keepAliveIntervalMs: number

    ping-pong interval for WS connection

  • linkPreviewImageThumbnailWidth: number

    width for link preview images

  • logger: Logger

    pino logger

  • makeSignalRepository: ((auth) => SignalRepository)
  • markOnlineOnConnect: boolean

    marks the client as online whenever the socket successfully connects

  • Optional mediaCache?: CacheStore

    provide a cache to store media, so does not have to be re-uploaded

  • Optional mobile?: boolean

    should baileys use the mobile api instead of the multi device api

  • Optional msgRetryCounterCache?: CacheStore

    map to store the retry counts for failed messages; used to determine whether to retry a message or not

  • options: AxiosRequestConfig<{}>

    options for axios

  • patchMessageBeforeSending: ((msg, recipientJids) => Promise<IMessage> | IMessage)
  • printQRInTerminal: boolean

    should the QR be printed in the terminal

  • Optional qrTimeout?: number

    time to wait for the generation of the next QR in ms

  • retryRequestDelayMs: number

    time to wait between sending new retry requests

  • shouldIgnoreJid: ((jid) => boolean | undefined)
      • (jid): boolean | undefined
      • Returns if a jid should be ignored, no event for that jid will be triggered. Messages from that jid will also not be decrypted

        Parameters

        • jid: string

        Returns boolean | undefined

  • shouldSyncHistoryMessage: ((msg) => boolean)
      • (msg): boolean
      • manage history processing with this control; by default will sync up everything

        Returns boolean

  • Optional socket?: any

    Socket passthrough

  • syncFullHistory: boolean

    Should Baileys ask the phone for full history, will be received async

  • transactionOpts: TransactionCapabilityOptions

    transaction capability options for SignalKeyStore

  • Optional userDevicesCache?: CacheStore

    provide a cache to store a user's device list

  • version: WAVersion

    version to connect with

  • waWebSocketUrl: string | URL

    the WS url to connect to WA

Generated using TypeDoc