Skip to content

MagfaSMS SDK

A JavaScript SDK for integrating applications with the MagFa SMS HTTP API.

MagfaSMS SDK provides a simple asynchronous interface for sending SMS messages, checking account balance, retrieving incoming messages, and tracking delivery status.

npm version

Package Information

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

Resources

Installation

npm install magfa-sdk@latest

Quick Start

import MagFa from "magfa-sdk";

const sms = new MagFa("username", "password", "domain", "3000xxxxxxx");

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

if (result.status === 0) {
  console.log(result.balance);
} else {
  console.log(sms.error(result.status));
}

The constructor accepts your MagFa username, password, domain, and sender number.

Available Features

  • Check account balance
  • Send SMS messages
  • Retrieve incoming messages
  • Check message delivery status
  • Translate MagFa status codes into readable error messages

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

License

See the source repository for licensing information.