messegy
v1.0.1
Published
Official Messegy Node.js SDK for sending WhatsApp template messages via API
Downloads
239
Readme
Messegy SDK
Official Node.js SDK for sending WhatsApp messages via Messegy API.
📦 Installation
npm install messegy🚀 Quick Start
import { sendWhatsAppMessage } from "messegy";
const res = await sendWhatsAppMessage({
phone: "7037564392",
templateName: "welcome_template",
variables: ["Rishabh"],
apiKey: "your_project_key",
apiSecret: "your_project_secret",
});
console.log(res);📌 Parameters
| Field | Type | Required | Description |
| ------------ | ------ | -------- | ----------------------------------------------------- |
| phone | string | ✅ | User phone number (auto formatted to 91 if 10 digits) |
| templateName | string | ✅ | WhatsApp template name |
| variables | array | ❌ | Template variables |
| apiKey | string | ✅ | Messegy Project Key |
| apiSecret | string | ✅ | Messegy Project Secret |
| language | string | ❌ | Default: en |
| buttonType | string | ❌ | url or quick_reply |
| buttonValue | string | ❌ | Button value |
🎯 Example with Button
import { sendWhatsAppMessage } from "messegy";
const res = await sendWhatsAppMessage({
phone: "917037564392",
templateName: "messegy_welcome_user_v1",
variables: ["Rishabh"],
language: "en",
apiKey: "your_project_key",
apiSecret: "your_project_secret",
// 🔹 Header (REQUIRED if template has header)
header: {
type: "image", // image | video | document | text
value: "https://blazync.com/assets/images/logo/blazync.png",
},
// 🔹 Button (optional)
button: {
type: "url", // url | quick_reply
value: "https://your-site.com",
},
});
console.log(res);📤 Response Format
{
success: true,
data: {...}
}or
{
success: false,
error: "Something went wrong"
}⚠️ Notes
- Phone numbers are auto-normalized (India default
91) - Ensure your template is approved on WhatsApp
- API credentials are required for every request
🛠️ Support
For issues or help, contact Messegy team.
