@wppconnect/wa-js - v4.1.0
    Preparing search index...

    Interface ConnEventTypes

    interface ConnEventTypes {
        "conn.auth_code_change": AuthCode | null;
        "conn.authenticated": undefined;
        "conn.backend_event": (eventName: BackendEventName, ...args: any[]) => void;
        "conn.logout": undefined;
        "conn.logout_reason": LogoutReason;
        "conn.main_init": undefined;
        "conn.main_loaded": undefined;
        "conn.main_ready": undefined;
        "conn.needs_update": undefined;
        "conn.online": boolean;
        "conn.qrcode_idle": undefined;
        "conn.require_auth": undefined;
        "conn.stream_info_changed": StreamInfo;
        "conn.stream_mode_changed": StreamMode;
    }
    Index

    Properties

    "conn.auth_code_change": AuthCode | null
    "conn.authenticated": undefined

    Triggered afted a success QR code scan

    WPP.on('conn.authenticated', () => {
    // Your code
    });
    "conn.backend_event": (eventName: BackendEventName, ...args: any[]) => void

    Triggered for every event emitted by WhatsApp Web's internal BackendEventBus. The first argument is the event name (one of the BackendEvent constant values). Some events carry additional arguments (e.g. set_socket_state passes the new state).

    WPP.on('conn.backend_event', (eventName, ...args) => {
    if (eventName === 'storage_initialization_error') {
    // Browser IndexedDB failed — clear profile and restart to recover
    }
    });
    "conn.logout": undefined
    "conn.logout_reason": LogoutReason
    "conn.main_init": undefined

    Triggered when the interface is booting

    WPP.on('conn.main_init', () => {
    // Your code
    });
    "conn.main_loaded": undefined

    Triggered when the main interface is loaded, but is syncing

    WPP.on('conn.main_loaded', () => {
    // Your code
    });
    "conn.main_ready": undefined

    Triggered when the main interface is loaded, authenticated and ready to send message

    WPP.on('conn.main_ready', () => {
    // Your code
    });
    "conn.needs_update": undefined

    Triggered when a whatsapp web update is requested

    WPP.on('conn.needs_update', () => {
    // Your code
    });
    "conn.online": boolean

    Triggered when the online change to online or offline

    WPP.on('conn.online', (online) => {
    if (online) {
    console.log('You are online');
    } else {
    console.log('You are offline');
    }
    });
    "conn.qrcode_idle": undefined
    "conn.require_auth": undefined
    "conn.stream_info_changed": StreamInfo

    Triggered when the stream info changes

    WPP.on('conn.stream_info_changed', (info) => {
    console.log('Stream info changed to:', info);
    });
    "conn.stream_mode_changed": StreamMode

    Triggered when the stream mode changes

    WPP.on('conn.stream_mode_changed', (mode) => {
    console.log('Stream mode changed to:', mode);
    });