azmarqomni
v0.2.0
Published
Official JavaScript SDK for the Azmarq SMS, WhatsApp, RCS, and OTP APIs
Maintainers
Readme
Azmarq Node.js SDK
Official JavaScript client for the Azmarq API. Node.js 18 or newer.
npm install azmarqomniCreate an API key in the Azmarq console under Developer → API Key, then:
const { Azmarq } = require("azmarqomni");
const client = new Azmarq(); // reads AZMARQ_API_KEY
const response = await client.send({
channel: "sms",
from: "SENDER",
to: "9800000001", // +91, 91, or 10-digit local
text: "Hello from Azmarq",
});
console.log(response.messageId);The same send({ channel }) works for WhatsApp and RCS. Channel-specific helpers (client.sms, client.whatsapp, client.rcs) are still there.
type is TRANS, PROMO, or OTP. Set unicode: 1 for non-GSM text and flash: 1 for a flash SMS. A list of numbers is sent as a comma-separated MSISDN string.
await client.sms.sendTemplate({
sender: "AOCAPI",
to: "919800000001",
templateId: "1507165650000000000",
custom: ["Ada", "ORD-1001"],
});
const started = await client.verify.generate({
configId: "your-config-id",
to: "919800000001",
});
await client.verify.validate({ verifyId: started.data, otp: "123456" });
await client.whatsapp.sendTemplate({
from: "+919800000000",
to: "+919800000001",
templateName: "order_update",
components: { body: { params: ["Ada", "ORD-1001"] } },
});
await client.rcs.send({
number: "+919800000001",
templateName: "plane_text",
botId: "YOUR_BOT_ID",
type: "TRANS",
});Catch AuthenticationError, InvalidRequestError, APIError, or ConnectionError. They all extend AzmarqError.
For a payload the helpers do not model, post the documented JSON:
await client.whatsapp.send({
from: "+919800000000",
to: "+919800000001",
type: "template",
templateName: "carousel_template",
components: {},
});TypeScript types ship with the package. Full reference: https://developers.azmarq.com
