vielhuber / wahelper
Lightweight whatsapp integration layer.
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Language:JavaScript
pkg:composer/vielhuber/wahelper
Requires
- php: >=8.1
README
wahelper is a lightweight whatsapp integration layer built on top of baileys that provides a simple cli, php wrapper, and mcp server for fetching messages, sending direct and group messages, and wiring whatsapp into existing tooling (wordpress, node, mcp clients) without having to deal with the full session lifecycle yourself.
requirements
- node >= 22
- php >= 8.1
installation
js
npm install @vielhuber/wahelper
php
composer require vielhuber/wahelper
.gitignore
/whatsapp_data/
usage
cli
npx wahelper \
--disable-warning=ExperimentalWarning \
--device "xxxxxxxxxxxx" \
...
--action "send_user" \
--number "xxxxxxxxxxxx" \
--message "This is a test! 🚀"
--action "send_group" \
--name "Group name" \
--message "This is a test! 🚀"
--action "send_user" \
--number "xxxxxxxxxxxx" \
--message "This is a test! 🚀" \
--attachments="/full/path/to/file.pdf,/full/path/to/image.png"
sqlite3 \
-header \
-column \
whatsapp.sqlite \
"SELECT text FROM messages ORDER BY timestamp ASC" | \
tail -10
php
require_once __DIR__ . '/vendor/autoload.php'; use vielhuber\wahelper\WhatsApp; // fetch messages WhatsApp::run([ 'device' => 'xxxxxxxxxxxx', 'action' => 'fetch_messages' ]); // send messages WhatsApp::run([ 'device' => 'xxxxxxxxxxxx', 'action' => 'send_user', 'number' => 'xxxxxxxxxxxx', 'message' => 'This is a test! 🚀' ]); WhatsApp::run([ 'device' => 'xxxxxxxxxxxx', 'action' => 'send_group', 'name' => 'Group name', 'message' => 'This is a test! 🚀' ]); // send attachments WhatsApp::run([ 'device' => 'xxxxxxxxxxxx', 'action' => 'send_user', // or 'send_group' /* ... */ 'attachments' => ['/full/path/to/file.pdf', '/full/path/to/image.png'] ]);
mcp
{
"mcpServers": {
"whatsapp": {
"command": "/root/.nvm/versions/node/v22.20.0/bin/node",
"args": ["/var/www/project/node_modules/@vielhuber/wahelper/WhatsApp.js", "--mcp"]
}
}
}