node-rocketsms
v0.5.0
Published
Modern RocketSMS SMS-gateway API.
Readme
node-rocketsms
Modern RocketSMS SMS-gateway API.
[!WARNING] This package is ESM-only and requires Node.js ≥ 18. It uses the built-in global
fetch(no third-party HTTP dependency), so load it withimport—require()is not supported.Requests reject only on network or HTTP-level failures. RocketSMS application errors are returned in the response body as
{ "error": "..." }, so check for anerrorfield on the result.
Features
- Supports API spec v1.5.0.
- Zero dependencies — built on native
fetchandcrypto, no third-party HTTP client. - Clear, lightful API layer
- Async/await/Promises
Installation
npm install node-rocketsmsExample Usage
import RocketSMS, { ENDPOINTS } from 'node-rocketsms';
const sms = new RocketSMS('username', 'password');
// Optionally target an alternative connection endpoint:
// const sms = new RocketSMS('username', 'password', ENDPOINTS.EU);Available endpoints (ENDPOINTS, also exposed as RocketSMS.ENDPOINTS):
| Key | Host | Use |
| --- | --- | --- |
| DEFAULT | https://api.rocketsms.by | Main endpoint, suitable for most clients |
| BY | https://api-by.rocketsms.by | Belarus (BTK/MTS protected segments) |
| EU | https://api.rocketsms.pl | European Union |
| RU | https://api.rocketsms.ru | Russia |
Create message
const result = await sms.send('375999999999', 'New message text!');Bulk message
const result = await sms.bulkSend(
['375999999999', '375888888888'],
'New message text!'
);Message status
const result = await sms.status(123456789);Account balance
const result = await sms.balance();Alfa-numbers list
const result = await sms.senders();Add alfa-number
const result = await sms.addSender('SenderName');Templates list
const result = await sms.templates();© 2026 Yauheni Pakala | MIT License
