Skip to main content
The authentication state manages credentials and cryptographic keys required for WhatsApp Web sessions.

AuthenticationState

The main authentication state object that combines credentials and key storage.
creds
AuthenticationCreds
required
Authentication credentials containing identity keys and account information
keys
SignalKeyStore
required
Key store for managing Signal protocol keys (pre-keys, sessions, etc.)

AuthenticationCreds

Extends SignalCreds with additional WhatsApp-specific authentication data.
signedIdentityKey
KeyPair
required
The signed identity key pair (readonly)
signedPreKey
SignedKeyPair
required
The signed pre-key pair (readonly)
registrationId
number
required
Signal protocol registration ID (readonly)
noiseKey
KeyPair
required
Noise protocol key pair for encryption (readonly)
pairingEphemeralKeyPair
KeyPair
required
Ephemeral key pair used during device pairing (readonly)
advSecretKey
string
required
Advanced secret key for device identity
me
Contact
Your own contact information
account
proto.IADVSignedDeviceIdentity
Signed device identity from WhatsApp
signalIdentities
SignalIdentity[]
Array of signal identities for registered devices
myAppStateKeyId
string
Key ID for app state synchronization
firstUnuploadedPreKeyId
number
required
ID of the first pre-key that hasn’t been uploaded to servers
nextPreKeyId
number
required
The next pre-key ID to generate
lastAccountSyncTimestamp
number
Unix timestamp of last account synchronization
platform
string
Platform identifier (e.g., “android”, “ios”)
processedHistoryMessages
MinimalMessage[]
required
Array of history messages that have been processed
accountSyncCounter
number
required
Number of times history and app state has been synced
accountSettings
AccountSettings
required
Account-level settings
registered
boolean
required
Whether the account is fully registered
pairingCode
string | undefined
required
Pairing code for linking devices
lastPropHash
string | undefined
required
Hash of last properties update
routingInfo
Buffer | undefined
required
Routing information for message delivery
additionalData
any | undefined
Additional custom data

Supporting Types

KeyPair

public
Uint8Array
required
Public key bytes
private
Uint8Array
required
Private key bytes

SignedKeyPair

keyPair
KeyPair
required
The key pair
signature
Uint8Array
required
Signature of the key pair
keyId
number
required
Unique identifier for this key
timestampS
number
Timestamp in seconds when the key was created

SignalIdentity

identifier
ProtocolAddress
required
Protocol address containing JID and device ID
identifierKey
Uint8Array
required
Identity key bytes

ProtocolAddress

name
string
required
The JID (WhatsApp ID)
deviceId
number
required
Device identifier

AccountSettings

unarchiveChats
boolean
required
Whether to unarchive chats when a new message is received
defaultDisappearingMode
Pick<proto.IConversation, 'ephemeralExpiration' | 'ephemeralSettingTimestamp'>
The default mode to start new conversations with for disappearing messages

SignalKeyStore

Interface for storing and retrieving Signal protocol keys.
get
function
required
Retrieve keys from the store
get<T extends keyof SignalDataTypeMap>(
  type: T, 
  ids: string[]
): Awaitable<{ [id: string]: SignalDataTypeMap[T] }>
set
function
required
Store keys in the store
set(data: SignalDataSet): Awaitable<void>
clear
function
Clear all data in the store
clear?(): Awaitable<void>

SignalDataTypeMap

Mapping of Signal data types to their value types:
pre-key
KeyPair
Pre-key pairs for establishing sessions
session
Uint8Array
Encrypted session state
sender-key
Uint8Array
Group message sender keys
sender-key-memory
{ [jid: string]: boolean }
Cache of distributed sender keys
app-state-sync-key
proto.Message.IAppStateSyncKeyData
Keys for syncing app state
app-state-sync-version
LTHashState
Version info for app state sync
lid-mapping
string
Mapping between phone numbers and LIDs
device-list
string[]
List of devices associated with an account
tctoken
{ token: Buffer; timestamp?: string }
Temporary credentials token
identity-key
Uint8Array
Identity keys for contacts

Build docs developers (and LLMs) love