TypeScript SDK (@wa-ma/sdk)
Install the framework-agnostic client and send text or media from Node.js or the browser.
Installation
Install from npm in your project (Node 18+ or modern browsers with fetch):
curl
npm install @wa-ma/sdkSend a text message
Create a Wama client with your instance whatsapp_api_key from the dashboard, then call sendText():
javascript
import { Wama } from '@wa-ma/sdk'
const wama = new Wama('YOUR_WHATSAPP_API_KEY')
const res = await wama.sendText('966501234567', 'Hello from WAMA! 🚀')
if (res.success) {
console.log('Queued. ID:', res.id)
} else {
console.error(res.message)
}Send media
Pass a URL, local file path (Node.js), Blob/File (browser), or Buffer as the media argument. The SDK converts it to a base64 data URI automatically:
javascript
await wama.sendImage(
'966501234567',
'https://example.com/banner.png',
'Check this out!'
)
// Node.js local file
await wama.sendDocument('966501234567', './invoice.pdf', 'Your invoice')Framework wrappers (@wa-ma/react, @wa-ma/vue, @wa-ma/angular) build on this package. See the Packages page for install commands.