Skip to content

PayamSMS SDK

A JavaScript SDK for integrating applications with the PayamSMS REST API.

PayamSMS SDK provides a simple asynchronous interface for interacting with the PayamSMS service, including checking account balance and sending SMS messages.

npm version

Package Information

Property Value
Package payamsms-sdk
Registry npm
Latest Version npm
Runtime Node.js
HTTP Client Axios

Resources

Installation

npm install payamsms-sdk@latest

Quick Start

import PayamSMS from "payamsms-sdk";

const sms = new PayamSMS("organization", "username", "password", "3000xxxxxxx");

// Check account balance
const result = await sms.getBalance();

console.log(result.balance);

Sending Messages

You can send multiple messages using an array of recipient and body objects.

const messages = [
  {
    recipient: "0912xxxxxxx",
    body: "Hello from PayamSMS",
  },
];

const result = await sms.send(messages);

console.log(result);

Notes

  • All SDK methods are asynchronous.
  • Organization-based authentication is required.
  • Incoming SMS retrieval is not currently implemented.

For complete API references and examples, visit the official documentation.

License

See the source repository for licensing information.