Node.js TypeScript SDK for WAHA (WhatsApp HTTP API) - auto-generated from OpenAPI spec
npm install @muhammedaksam/waha-node



TypeScript SDK for WAHA (WhatsApp HTTP API) - auto-generated from OpenAPI spec with full type safety and axios-based client.
``bash`
npm install @muhammedaksam/waha-nodeor
pnpm add @muhammedaksam/waha-nodeor
yarn add @muhammedaksam/waha-node
The WahaClient aggregates all controllers for convenience:
`typescript
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:
`typescript
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:
`typescript`
client.sessions.* // SessionsController
client.chatting.* // ChattingController
client.contacts.* // ContactsController
client.groups.* // GroupsController
client.auth.* // AuthController
// ...etc
All 200+ types are auto-generated from the WAHA OpenAPI specification:
`typescript`
import {
SessionInfo,
MessageTextRequest,
WAMessage,
QRCodeValue,
// ... and many more
} from '@muhammedaksam/waha-node'
This package is automatically kept in sync with WAHA:
1. Daily - GitHub Action spins up latest devlikeapro/waha container/-json
2. Fetches OpenAPI spec from endpointopenapi.json
3. Compares SHA256 hash with committed
4. If changed - Generates new types + client, bumps version, commits, and pushes tag
5. 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)
`bashStart WAHA (credentials will be auto-generated in logs)
docker run -d -p 3000:3000 --name waha devlikeapro/waha:latest
$3
| 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