Package selection guidance compiled from public package information, community data, and project usage.
A Flutter/Dart package enabling WhatsApp bot functionality through web scraping via Puppeteer, designed for desktop and web applications. It allows developers to automate interactions with WhatsApp Web by leveraging headless browser capabilities. The package supports cross-platform deployment on Web, macOS, Windows, and Linux, making it ideal for building custom messaging tools. It integrates seamlessly into Flutter projects, offering a bridge between Dart logic and browser-based WhatsApp interactions.
Use cases
Automated customer support messaging
Bulk message broadcasting
Scheduled WhatsApp notifications
Interactive chatbot interfaces
Desktop-based WhatsApp automation
Key features
Puppeteer-powered WhatsApp Web scraping
Cross-platform support (Web, macOS, Windows, Linux)
Flutter and Dart project integration
Headless browser automation
Real-time message handling
Lightweight and easy setup
Suitable for
Developers building desktop/web WhatsApp bots
Teams needing automated messaging solutions
Projects requiring WhatsApp integration without official API
Educational or prototyping use cases
Considerations
Relies on WhatsApp Web's public interface (may break with updates)
Requires user authentication via QR code
Potential rate limiting or bans from WhatsApp
Not officially supported by WhatsApp
Depends on stable Puppeteer performance across platforms
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
Whatsapp bot flutter
Getting Started
We can use this library in Flutter as well as Pure dart projects , checkout dart_example
First launch on Desktop apps will take some time, it will download chromium files locally, using puppeteer
Usage
Get WhatsappClient using connect method
Either link with QRCode (default) and get QrCode in onQrCode callback or set linkWithPhoneNumber, and get code in onPhoneLinkCode callback
// use WhatsappBotFlutterMobile.connect for Android/IOS platformsWhatsappClient? whatsappClient = awaitWhatsappBotFlutter.connect(
onConnectionEvent: (ConnectionEvent event) {
print(event.toString());
},
onQrCode: (String qr, Uint8List? imageBytes) {
// use imageBytes to display in flutter : Image.memory(imageBytes)print(WhatsappBotFlutter.convertStringToQrCode(qr));
},
);
We have these modules to access whatsappClient features :
phone parameter can be of this format : countryCode+phoneNumber , eg : 91xxxxxxxxxx , or we can get phone from messageEvents in this format : countryCode+phone+"@c.us"
Supported Whatsapp features :
- Create multiple whatsapp clients
Login with QR
Auto refresh QrCode
Logout
Keep session
Listen to whatsapp events
Reject calls
Send text message
Send image, audio & document
Send location message
Send poll in groups
Send contact card
Reply to a message
Archive/Unarchive chats
Mute/Unmute chat
Clear chat
Delete chat
Get lastSeen
Get chats
Mark messages as seen
Mark message as unread
Pin/Unpin chat
Delete messages
Download media
Get messages
Get profile picture
Get status
Get contacts
Get status of loggedIn user
Set status
check if logged in user have business account
Set profile picture of logged in user
and many more..
Mobile Setup (Android/IOS)
To setup on Android , make sure to checkout flutter_inappwebview documentation for Android and IOS setup
Android sdk:minSdkVersion cannot be smaller than version 19
Desktop setup (Windows/Mac/Linux)
For Macos , Enable outgoing and incoming connections, If getting sandbox issue , try disabling sandbox mode comment this out in macos/Runner/*.entitlements:
<key>com.apple.security.app-sandbox</key>
<true/>
Should run out of the box in Windows and Linux
Web setup
checkout web demo app : https://rohitsangwan01.github.io/whatsapp_bot_flutter
We can use browserless, Create a free account there and get API_TOKEN from browserless, and use this url to connect : wss://chrome.browserless.io?token=API_TOKEN
Or we can run puppeteer, and get browserWsEndpoint from there and pass into the connect method, checkout this example
then pass this browserWsEndpoint in connect method, and also requires wppJsContent, we can download this file from here, add this file in assets and pass like this,
We can use this on Mobile or Desktop platforms as well , to connect to a chrome server hosted somewhere else
If we have to access this webSocket url locally on Mobile or other platforms , we can use ngrok to expose our local Websocket url to internet
Resources
Thanks to wa-js for exporting functions from WhatsApp Web
Disclaimer
This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with WhatsApp or any of its subsidiaries or its affiliates. The official WhatsApp website can be found at https://whatsapp.com. "WhatsApp" as well as related names, marks, emblems and images are registered trademarks of their respective owners.
Note
Its just initial version, I can't guarantee you will not be blocked by using this method, try to avoid primary whatsapp numbers. WhatsApp does not allow bots or unofficial clients on their platform, so this shouldn't be considered totally safe.