TypeScript SDK for WAHA (WhatsApp HTTP API) - auto-generated from OpenAPI spec with full type safety and axios-based client.
npm install @muhammedaksam/waha-node
# or
pnpm add @muhammedaksam/waha-node
# or
yarn add @muhammedaksam/waha-nodeThe WahaClient aggregates all controllers for convenience:
import { WahaClient } from '@muhammedaksam/waha-node'
// Initialize with baseURL and optional API key
const client = new WahaClient('http://localhost:3000', 'your-api-key')
// Access controllers via properties
// Sessions
const { data: sessions } = await client.sessions.sessionsControllerList()
// Chatting
const { data: message } = await client.chatting.chattingControllerSendText('default', {
chatId: '1234567890@c.us',
text: 'Hello from waha-node!',
session: 'default',
})
// Auth
const { data: qr } = await client.auth.authControllerGetQr('default', {
format: 'raw',
})If you only need specific functionality, you can import individual controllers:
import { Chatting, HttpClient } from '@muhammedaksam/waha-node'
const http = new HttpClient({
baseUrl: 'http://localhost:3000',
securityWorker: () => ({ headers: { 'X-Api-Key': 'your-api-key' } }),
})
const chatting = new Chatting(http)
await chatting.chattingControllerSendText(...)All endpoints are available through the client properties:
client.sessions.* // SessionsController
client.chatting.* // ChattingController
client.contacts.* // ContactsController
client.groups.* // GroupsController
client.auth.* // AuthController
// ...etcAll 200+ types are auto-generated from the WAHA OpenAPI specification:
import {
SessionInfo,
MessageTextRequest,
WAMessage,
QRCodeValue,
// ... and many more
} from '@muhammedaksam/waha-node'This package is automatically kept in sync with WAHA:
- Daily - GitHub Action spins up latest
devlikeapro/wahacontainer - Fetches OpenAPI spec from
/-jsonendpoint - Compares SHA256 hash with committed
openapi.json - If changed - Generates new types + client, bumps version, commits, and pushes tag
- Publishes to npm via OIDC trusted publishing
The openapi.json is committed so you can see exactly what changed between versions.
- Node.js >= 18
- pnpm
- Running WAHA instance (for type generation)
# Start WAHA (credentials will be auto-generated in logs)
docker run -d -p 3000:3000 --name waha devlikeapro/waha:latest
# Get the generated password from logs
docker logs waha 2>&1 | grep WHATSAPP_SWAGGER_PASSWORD
# Set credentials and generate
export SWAGGER_USER=admin
export SWAGGER_PASSWORD=<password-from-logs>
pnpm run generate
# Build
pnpm run build| Script | Description |
|---|---|
pnpm run generate |
Fetch OpenAPI spec and generate types + client |
pnpm run build |
Build ESM/CJS bundles |
pnpm run clean |
Remove dist folder |
MIT