Prerequisites
Before installing whatsapp-rust, ensure you have:- Rust 2024 edition or later (requires recent stable Rust)
- Cargo package manager
- SQLite (if using the default storage backend)
Add to your project
Add whatsapp-rust and its required dependencies to yourCargo.toml:
Feature flags
whatsapp-rust supports several optional features:| Feature | Description | Included by default |
|---|---|---|
sqlite-storage | SQLite storage backend | ✅ Yes |
tokio-transport | Tokio WebSocket transport | ✅ Yes |
ureq-client | Ureq HTTP client | ✅ Yes |
tokio-native | Tokio multi-threaded runtime | ✅ Yes |
signal | Unix signal handling | ❌ No |
danger-skip-tls-verify | Skip TLS verification (unsafe) | ❌ No |
debug-snapshots | Debug protocol snapshots | ❌ No |
The default features provide everything needed for most use cases. Only customize features if you have specific requirements.
Custom features example
If you want to use only specific features:Cargo.toml
Verify installation
Create a simple test file to verify the installation:src/main.rs
Next steps
Quickstart
Build your first WhatsApp bot in minutes