smsnova-sdk
v1.0.0
Published
Official Node.js SDK for SMSNova temporary phone number and automated SMS OTP verification API.
Downloads
204
Maintainers
Readme
SMSNova Node.js SDK
The official Node.js client for requesting a temporary phone number, checking SMS activation inventory, and retrieving OTP verification messages through the SMSNova API.
Use temporary numbers only where permitted by the target platform, applicable law, and SMSNova's policies. This package is intended for legitimate testing, privacy, and account-verification workflows—not spam, fraud, account farming, or bypassing platform controls.
Requirements
- Node.js 18 or newer
- An SMSNova API key
Installation
npm install smsnova-sdkQuick Start
Keep API keys on your server and load them from environment variables. Never commit a key or expose it in browser code.
const SMSNova = require('smsnova-sdk');
const client = new SMSNova(process.env.SMSNOVA_API_KEY);
async function verify() {
const balance = await client.getBalance();
console.log('Balance:', balance);
const order = await client.getNumber('telegram', 'in');
console.log('Allocated order:', order);
const result = await client.waitForOTP(order.id);
console.log('OTP response:', result);
}
verify().catch((error) => {
console.error(error.name, error.status, error.message);
process.exitCode = 1;
});The client defaults to https://smsnova.net/api/v1 and sends the API key as a Bearer token. If your SMSNova account uses another API prefix, pass its documented URL:
const client = new SMSNova(process.env.SMSNOVA_API_KEY, {
baseURL: process.env.SMSNOVA_API_URL,
timeout: 30_000
});API Reference
All methods return the parsed response body and reject with SMSNovaError when a network or API request fails.
| Method | Description |
| --- | --- |
| getBalance() | Query the current account balance. |
| getServices() | Fetch available services and rates. |
| getCountries() | Fetch supported country codes. |
| getNumber(serviceCode, countryCode = 'vn') | Allocate a temporary number and create an order. |
| getOTP(orderId) | Retrieve the current order, SMS content, and OTP. |
| cancelOrder(orderId) | Cancel an active order. |
| waitForOTP(orderId, timeoutMs = 60000, intervalMs = 3000) | Poll until an otp or code is returned. |
Named exports are also available:
const { SMSNova, SMSNovaError } = require('smsnova-sdk');Error Handling
const { SMSNovaError } = require('smsnova-sdk');
try {
await client.getBalance();
} catch (error) {
if (error instanceof SMSNovaError) {
console.error({
message: error.message,
status: error.status,
code: error.code,
details: error.details
});
}
}Supported Countries & Regions
Availability and pricing can change. Call getCountries() for live inventory.
| Country or region | SMSNova information | | --- | --- | | India | Temporary Phone Number India | | United States | Temporary Phone Number USA | | Nigeria | Temporary Phone Number Nigeria | | Bangladesh | Temporary Phone Number Bangladesh | | Egypt | Temporary Phone Number Egypt | | All locations | View all supported countries |
Supported Services & Platforms
Service availability depends on country and current inventory. Call getServices() for live rates.
| Platform | SMS verification information | | --- | --- | | Telegram | SMS Verification for Telegram | | Facebook | SMS Verification for Facebook | | TikTok / Douyin | SMS Verification for Tiktok | | Google / Gmail / YouTube | SMS Verification for Google | | X / Twitter | SMS Verification for X | | Apple | SMS Verification for Apple | | All platforms | View all supported services |
Security & Compliance
- Store API keys in a secrets manager or environment variable.
- Do not log credentials, authorization headers, full phone numbers, or SMS contents.
- Set reasonable polling intervals and handle rate limits returned by the API.
- Cancel unused orders and retain verification data only as long as necessary.
- Review the SMSNova Privacy Policy and comply with all applicable laws and third-party platform terms.
To report a suspected vulnerability privately, email [email protected]. Please do not disclose unresolved security issues in a public ticket.
Official Community & Socials
- YouTube: https://www.youtube.com/@SMSNovaGlobal
- X (Twitter): https://x.com/SMSNovaGlobal
- Facebook: https://facebook.com/SMSNovaGlobal
- Telegram: https://t.me/SMSNovaGlobal
- Threads: https://www.threads.net/@smsnovaglobal
- Pinterest: https://pinterest.com/SMSNovaGlobal
- Linktree: https://linktr.ee/SMSNovaGlobal
- Contact Support: https://smsnova.net/contact
License
Released under the MIT License.
