How tulir/whatsmeow works
whatsmeow is a Go client library for WhatsApp’s multidevice API. A consumer creates a client with a device store, connects and authenticates, then uses client APIs to exchange messages and manage chats; registered handlers receive events. The graph highlights transport, protocol encoding, persistent device/session state, app-state synchronization, and documented messaging and chat capabilities. Some feature modules were not sampled, so their links are dashed where the precise runtime caller is unverified.
Main entry points: client.go WhatsApp client · send.go Message sending · store.go Device store API · framesocket.go WebSocket frames
Components 17
Connection and sessions
- WhatsApp client
client.go - WebSocket frames
socket/framesocket.go - Login handshake
handshake.go
Protocol and events
- Binary node codec
binary/decoder.go - Legacy proto aliases
binary/proto/legacy.go - Event types
types/events/events.go
Messaging and chat
- Message sending
send.go - Message receiving
message.go - Media transfer
upload.go - Group management
group.go - Presence and receipts
presence.go
Device and sync state
- App-state sync
appstate/decode.go - Device store API
store/store.go - SQL persistence
store/sqlstore/store.go - Login payload
store/clientpayload.go
Other components
- Library consumer
- WhatsApp servers
Connections 20
- Library consumer → WhatsApp client: creates and uses
client.go - WhatsApp client → WebSocket frames: connects through
client.go - WhatsApp client → Login handshake: runs login
- WebSocket frames → WhatsApp servers: exchanges frames
socket/framesocket.go - WhatsApp client → Device store API: accepts device store
client.go - WhatsApp client → Event types: dispatches events
client.go - Library consumer → Event types: handles events
types/events/events.go - WhatsApp client → Message sending: offers messaging
- WhatsApp client → Message receiving: receives messages
- Message sending → WhatsApp servers: sends messages
- Message receiving → WhatsApp servers: receives messages
- Message sending → Media transfer: supports media
- WhatsApp client → Group management: manages groups
- WhatsApp client → Presence and receipts: exchanges presence and receipts
- WhatsApp client → App-state sync: syncs app state
- App-state sync → Device store API: uses sync storage
appstate/decode.go - SQL persistence → Device store API: implements store API
store/sqlstore/store.go - WhatsApp client → Login payload: configures login
- WhatsApp client → Binary node codec: decodes protocol nodes
- Binary node codec → Legacy proto aliases: uses protobuf types