Class: RemoteAuth

RemoteAuth(options)

Remote-based authentication

Constructor

new RemoteAuth(options)

Parameters:
Name Type Description
options object

options

Properties
Name Type Description
store object

Remote database store instance

clientId string

Client id to distinguish instances if you are using multiple, otherwise keep null if you are using only one instance

dataPath string

Change the default path for saving session files, default is: "./.wwebjs_auth/"

backupSyncIntervalMs number

Sets the time interval for periodic session backups. Accepts values starting from 60000ms {1 minute}

initialSyncDelayMs number

Delay before the first checkpoint for a newly paired session

identityResolver function

Trusted resolver for the companion fingerprint; required for verified native PostgreSQL mode

requireFingerprintVerification boolean

Fail readiness unless the trusted fingerprint matches. Defaults to true in production.

allowNoiseMetadataBootstrap boolean

Allow the official WWeb noise metadata regeneration path when importing a native-provider candidate.

canonicalFlushDebounceMs number

Debounce for critical canonical-only flushes. Defaults to 1000ms.

canonicalAppStateCatchUpTimeoutMs number

Maximum handoff app-state catch-up time. Defaults to 120000ms.

canonicalAppStatePollIntervalMs number

App-state watermark polling interval. Defaults to 2000ms.

rmMaxRetries number

Sets the maximum number of retries for removing the session directory

Source:

Methods

(async) afterInitializationFailureBrowserClosed()

Client invokes this only after Chromium has been closed. Keeping local profile deletion and owned-pool shutdown on this side of that boundary prevents Chrome from recreating files while cleanup runs.

Source:

checkpoint()

Queues a serialized durable checkpoint. Periodic calls are coalesced so a slow store can never build an unbounded interval backlog.

Source:

(async) checkpointInitialNativePairingReady()

The initial PostgreSQL pairing checkpoint races with the last app-state IndexedDB transaction even after the readiness sample was stable. The live Chromium profile can also change while its artifact is streamed. Retry only those two explicit transient conditions and keep every other checkpoint failure fatal.

Source:

(async) finalizeNativeFailure()

Fail closed while the fencing lease is still owned: stop browser writes, attempt the handoff rollback, and release the lease only after Chromium termination is proven. Cleanup failures are aggregated with the primary error using fixed messages so credentials or key material never become log/event labels.

Source:

(async) installCanonicalWebSocketGate()

A cross-provider candidate must load WhatsApp's runtime before its canonical credentials can be written. A dedicated MV3 extension blocks every WebSocket at Chromium's request boundary during that first load, so the empty bootstrap profile cannot request a pairing ref or race the source companion. The extension is removed only while the page is offline, after the imported tuple passed its readback gate.

Source:

isCanonicalActivationRecoveryRequired()

Stop every local writer before a rollback or lease release. Concurrent failure paths share one promise so Chromium and the bridge are closed at most once during an initialization lifecycle.

Source:

isPostPointOfNoReturnRecoveryPending()

Returns only in-memory evidence backed by the durable active-revision activation marker. The Client uses this during failure cleanup to advertise forward recovery without ever claiming ONLINE or exposing a replacement QR after the point of no return.

Source:

reconcileResolvedIdentityWebVersion()

Keep the live/latest store binding aligned with the document that produced the trusted companion identity. A controlled native-stall recovery may reload WhatsApp Web after the earlier ABI preflight and the live endpoint can legitimately serve a newer (or adjacent rollout) build. getCompanionIdentity() attests the module ABI, web version and companion fingerprint from that same document, so an unpinned store may safely rebind here. Integrity-pinned stores remain strictly fail-closed.

Source:

(async) rollbackHandoff()

Collapse concurrent failure paths onto one fenced rollback. A transient database failure is retried while the lease is still owned; callers must not release the lease until this method resolves.

Source:

(async) shutdown()

Persists a final checkpoint without deleting the remote session, then removes the ephemeral Chromium profile.

Source: