@japofc/baileys - v2.4.7
    Preparing search index...

    Interface AutoReconnectOptions

    Drop-in auto-reconnect for direct makeWASocket users (the Framework Bot already has this built in). Exponential backoff with jitter, never reconnects on loggedOut, immediate reconnect on restartRequired.

    J.AP

    interface AutoReconnectOptions {
        baseDelayMs?: number;
        jitter?: number;
        logger?: any;
        maxAttempts?: number;
        maxDelayMs?: number;
        onGiveUp?: (
            info: {
                attempts: number;
                error?: unknown;
                reason: "factory-failed" | "max-attempts";
                statusCode?: number;
                getStatus(): {
                    attempts: number;
                    hasSocket: boolean;
                    reconnectPending: boolean;
                    started: boolean;
                    stopped: boolean;
                };
            },
        ) => void;
        onLoggedOut?: (error: unknown) => void;
        onOpen?: (sock: any) => void;
        onSocket?: (sock: any) => void;
    }
    Index
    baseDelayMs?: number

    First retry delay in ms (default 1000).

    jitter?: number

    Random jitter fraction 0-1 applied to each delay (default 0.25).

    logger?: any
    maxAttempts?: number

    Give up after this many consecutive failed attempts (default Infinity).

    maxDelayMs?: number

    Backoff cap in ms (default 30000).

    onGiveUp?: (
        info: {
            attempts: number;
            error?: unknown;
            reason: "factory-failed" | "max-attempts";
            statusCode?: number;
            getStatus(): {
                attempts: number;
                hasSocket: boolean;
                reconnectPending: boolean;
                started: boolean;
                stopped: boolean;
            };
        },
    ) => void

    Called once when the session is logged out (no reconnect will follow) — clean up creds here.

    onLoggedOut?: (error: unknown) => void
    onOpen?: (sock: any) => void

    Called when a connection reaches 'open'.

    onSocket?: (sock: any) => void

    Called with every fresh socket (initial + each reconnect) — attach your event handlers here.