Skip to main content

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 your Cargo.toml:
[dependencies]
whatsapp-rust = "0.3"
whatsapp-rust-sqlite-storage = "0.3"
whatsapp-rust-tokio-transport = "0.3"
whatsapp-rust-ureq-http-client = "0.3"
wacore = "0.3"
waproto = "0.3"
tokio = { version = "1.48", features = ["macros", "rt-multi-thread"] }

Feature flags

whatsapp-rust supports several optional features:
FeatureDescriptionIncluded by default
sqlite-storageSQLite storage backend✅ Yes
tokio-transportTokio WebSocket transport✅ Yes
ureq-clientUreq HTTP client✅ Yes
tokio-nativeTokio multi-threaded runtime✅ Yes
signalUnix signal handling❌ No
danger-skip-tls-verifySkip TLS verification (unsafe)❌ No
debug-snapshotsDebug 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
[dependencies]
whatsapp-rust = { version = "0.3", default-features = false, features = ["sqlite-storage", "tokio-transport"] }

Verify installation

Create a simple test file to verify the installation:
src/main.rs
use whatsapp_rust::bot::Bot;

fn main() {
    println!("whatsapp-rust installed successfully!");
}
Run it with:
cargo run
If you see “whatsapp-rust installed successfully!”, you’re ready to move on to the Quickstart guide.

Next steps

Quickstart

Build your first WhatsApp bot in minutes