Interface ConnEventTypes

interface ConnEventTypes {
    conn.auth_code_change: null | AuthCode;
    conn.authenticated: undefined;
    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;
}

Properties

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

Triggered afted a success QR code scan

WPP.on('conn.authenticated', () => {
// Your code
});
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