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).
Example
WPP.on('conn.backend_event', (eventName, ...args) => { if (eventName === 'storage_initialization_error') { // Browser IndexedDB failed — clear profile and restart to recover } });
conn.link_code_change
"conn.link_code_change":string
Triggered when a managed phone-number linking code is generated.
conn.link_code_error
"conn.link_code_error":Error
Triggered when the managed phone-number linking flow fails.
conn.link_code_expired
"conn.link_code_expired":undefined
Triggered when the active phone-number linking code requires manual refresh.
Triggered afted a success QR code scan