Official Node.js SDK for the StackVerify SMS API.
Simple. Fast. Reliable.
- Fast SMS delivery
- Clean REST API
- Production-ready Node SDK
- Automatic retries and timeouts
- Fully typed for TypeScript
- 20 free SMS every month
- More sharing = more free SMS credits
Start sending SMS in minutes.
Get your API key at:
Every developer integrating the StackVerify SDK receives:
- 20 free SMS every month
- Increased free SMS allocation when you share StackVerify
No credit card required to start.
npm install stackverify-smsRequirements:
- Node.js 18 or higher
// test.cjs
const { StackVerify } = require("stackverify-sms");
const client = new StackVerify({
apiKey: "sk_live_your_api_key_here",
timeout: 20000 // 20 seconds
});
(async () => {
try {
const res = await client.sms.send({
recipients: ["+254712345678"],
body: "Hello from StackVerify!",
sender_id: "SMS" // optional, default is "SMS"
});
console.log("SMS sent:", res);
} catch (err) {
console.error("Request failed. Possibly network timeout or server issue:", err);
}
})();// test.mjs
import { StackVerify } from "stackverify-sms";
const client = new StackVerify({
apiKey: process.env.STACKVERIFY_KEY,
timeout: 20000 // 20 seconds
});
try {
const res = await client.sms.send({
recipients: ["+254712345678"],
body: "Hello from StackVerify!",
sender_id: "SMS" // optional, default is "SMS"
});
console.log("SMS sent:", res);
} catch (err) {
console.error("Request failed. Possibly network timeout or server issue:", err);
}Fully typed SDK with IntelliSense support.
import { StackVerify, StackVerifyError } from "stackverify-sms";
const client = new StackVerify({
apiKey: process.env.STACKVERIFY_KEY!,
timeout: 5000,
retries: 3
});
async function sendSMS(): Promise<void> {
try {
const response = await client.sms.send({
recipients: ["+254712345678"],
body: "TypeScript SMS example",
sender_id: "MYAPP"
});
console.log("Success:", response);
} catch (error) {
if (error instanceof StackVerifyError) {
console.error("Status:", error.status);
console.error("Message:", error.message);
}
}
}
sendSMS();client.sms.send({
recipients: string[],
body: string,
sender_id?: string
});| Field | Type | Required | Description |
|---|---|---|---|
| recipients | string[] | Yes | Phone numbers in international format |
| body | string | Yes | SMS content |
| sender_id | string | No | Custom sender ID |
If sender_id is not provided, the default sender ID is:
SMS
const client = new StackVerify({
apiKey: "sk_live_your_api_key",
timeout: 10000, // default 10000ms
retries: 2 // default 2 retries
});The SDK throws StackVerifyError for API failures.
try {
await client.sms.send({
recipients: ["+254712345678"],
body: "Test"
});
} catch (error) {
console.error(error);
}- Store your API key in environment variables
- Do not expose your API key in frontend applications
- Rotate your API keys periodically
We reward developers who build with StackVerify.
- Start with 20 free SMS monthly
- Share StackVerify with your community
- Get increased monthly free SMS allocation
Contact support through your dashboard to increase your limits.
This SDK includes:
- Automatic retry with exponential backoff
- Request timeout handling
- Structured error classes
- CommonJS and ESM compatibility
- TypeScript declarations
Built for real-world production usage.
Website: https://stackverify.site
Email: support@stackverify.site
MIT