Quick Start
Quick Start
Get up and running with WAHooks in 5 minutes
This guide walks you through connecting a WhatsApp number, receiving webhooks, and sending your first message.
Prerequisites
- A WAHooks account (sign up)
- A WhatsApp account on your phone
- An API token (create one in the dashboard or via CLI)
1. Install the SDK and CLI
npm install @wahooks/sdkpip install wahooksInstall the CLI to manage connections and tokens from your terminal:
curl -fsSL https://wahooks.com/install | bashbrew install dhruvyad/tap/wahooksnpm install -g @wahooks/cli2. Create an API token
wahooks login
wahooks tokens create my-app# Use your Supabase JWT from the dashboard
curl -X POST https://api.wahooks.com/api/tokens \
-H "Authorization: Bearer YOUR_JWT" \
-H "Content-Type: application/json" \
-d '{"name": "my-app"}'Save the token — it's shown only once. It looks like wh_a1b2c3....
3. Create a connection and scan QR
import { WAHooks } from '@wahooks/sdk';
const client = new WAHooks({ apiKey: 'wh_...' });
const connection = await client.createConnection();
console.log('Connection ID:', connection.id);
// Get QR code to scan with WhatsApp
const qr = await client.getQR(connection.id);
console.log('Scan this QR:', qr.value);from wahooks import WAHooks
client = WAHooks(api_key="wh_...")
connection = client.create_connection()
print("Connection ID:", connection["id"])
# Get QR code to scan with WhatsApp
qr = client.get_qr(connection["id"])
print("Scan this QR:", qr["value"])Open the QR code in WhatsApp: Settings → Linked Devices → Link a Device.
4. Set up a webhook
const webhook = await client.createWebhook(
connection.id,
'https://your-server.com/webhook',
);
console.log('Webhook created:', webhook.id);
console.log('Signing secret:', webhook.signingSecret);webhook = client.create_webhook(
connection["id"],
url="https://your-server.com/webhook",
)
print("Webhook created:", webhook["id"])
print("Signing secret:", webhook["signingSecret"])5. Send a message
await client.sendMessage(
connection.id,
'1234567890@s.whatsapp.net',
'Hello from WAHooks!'
);client.send_message(
connection["id"],
chat_id="1234567890@s.whatsapp.net",
text="Hello from WAHooks!",
)Chat IDs use the format {phone}@s.whatsapp.net for individual chats
and {id}@g.us for group chats.
Next steps
- Receive webhooks — handle incoming messages
- Webhook signatures — verify webhook authenticity
- API Reference — explore all endpoints