npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

sms-kit

v0.0.4

Published

Multi-provider SMS sender with a unified API

Readme

SMS Kit - Multi-Provider SMS Sender

An easy-to-use SMS sender with a unified API for multiple providers. This kit focuses on a clean, dependency-free core and lets you plug provider credentials via config or environment variables.

Installation

npm install sms-kit

Importing the Module

import { sendSms } from "sms-kit";

Usage

You can send SMS messages by calling the sendSms function with a provider and message object.

sendSms function

sendSms({
  provider: "twilio", // Choose a provider id
  message: {
    to: ["+8801712345678"], // Recipients in international format
    message: "Hello from sms-kit!",
    senderId: "MyBrand", // Optional override
  },
  config: {
    accountSid: "your_twilio_sid",
    authToken: "your_twilio_token",
    from: "+15005550006",
  },
});

Example:

import { sendSms } from "sms-kit";

// Send an SMS message
sendSms({
  provider: "smsto",
  message: {
    to: ["+8801712345678"],
    message: "Hello from sms-kit!",
  },
  config: {
    apiKey: "your_smsto_key",
    senderId: "MyBrand",
  },
}).then((response) => {
  console.log("SMS Response:", response);
});

Environment Variables

Each provider uses its own environment variables. Provide them in your runtime or a .env file (loaded by your app). Examples:

TWILIO_ACCOUNT_SID=your_twilio_sid
TWILIO_AUTH_TOKEN=your_twilio_token
TWILIO_FROM=+15005550006

MESSAGEBIRD_API_KEY=your_messagebird_key
MESSAGEBIRD_ORIGINATOR=MyBrand

SMSTO_API_KEY=your_smsto_key
SMSTO_SENDER_ID=MyBrand

TEXTLOCAL_API_KEY=your_textlocal_key
TEXTLOCAL_SENDER=MyBrand

BULKSMS_TOKEN_ID=your_bulksms_token_id
BULKSMS_TOKEN_SECRET=your_bulksms_token_secret

[email protected]
MIMSMS_API_KEY=your_mimsms_key
MIMSMS_SENDER_NAME=MyBrand
MIMSMS_TRANSACTION_TYPE=T
MIMSMS_CAMPAIGN_ID=

SMSNETBD_API_KEY=your_smsnetbd_key
SMSNETBD_SENDER_ID=MyBrand
SMSNETBD_SCHEDULE=2021-10-13 16:00:52
SMSNETBD_CONTENT_ID=

BULKSMSBD_API_KEY=your_bulksmsbd_key
BULKSMSBD_SENDER_ID=MyBrand

AUTOMAS_API_KEY=your_automas_key
AUTOMAS_SENDER_ID=AUTOMAS
AUTOMAS_API_BASE_URL=https://api.automas.sms.com

Error Handling

The sendSms function will return an object with the following structure:

{
  success: boolean;
  provider: "twilio" | "messagebird" | "smsto" | "textlocal" | "bulksms" | "mimsms" | "smsnetbd" | "bulksmsbd" | "automas" | "unknown";
  data?: unknown;
  error?: string;
  statusCode?: number;
}
  • success: true if the SMS was successfully sent, false otherwise.
  • data: The response data from the SMS provider if the request was successful.
  • error: A string describing the error message if the request failed.

Example of error response:

{
  success: false,
  error: "Failed to send SMS. Status: 500"
}

Providers

Current provider ids:

  • twilio
  • messagebird
  • smsto
  • textlocal
  • bulksms
  • mimsms
  • smsnetbd
  • bulksmsbd
  • automas

Provider Examples

import { sendSms } from "sms-kit";

// Twilio
await sendSms({
  provider: "twilio",
  message: {
    to: ["+15005550006"],
    message: "Twilio test message",
  },
  config: {
    accountSid: "your_twilio_sid",
    authToken: "your_twilio_token",
    from: "+15005550006",
  },
});
import { sendSms } from "sms-kit";

// MessageBird
await sendSms({
  provider: "messagebird",
  message: {
    to: ["+8801712345678"],
    message: "MessageBird test message",
  },
  config: {
    accessKey: "your_messagebird_key",
    originator: "MyBrand",
  },
});
import { sendSms } from "sms-kit";

// SMS.to
await sendSms({
  provider: "smsto",
  message: {
    to: ["+8801712345678"],
    message: "SMS.to test message",
  },
  config: {
    apiKey: "your_smsto_key",
    senderId: "MyBrand",
  },
});
import { sendSms } from "sms-kit";

// Textlocal
await sendSms({
  provider: "textlocal",
  message: {
    to: ["+447000000000"],
    message: "Textlocal test message",
  },
  config: {
    apiKey: "your_textlocal_key",
    sender: "MyBrand",
  },
});
import { sendSms } from "sms-kit";

// BulkSMS
await sendSms({
  provider: "bulksms",
  message: {
    to: ["+447000000000"],
    message: "BulkSMS test message",
  },
  config: {
    tokenId: "your_bulksms_token_id",
    tokenSecret: "your_bulksms_token_secret",
  },
});
import { sendSms } from "sms-kit";

// MiMSMS
await sendSms({
  provider: "mimsms",
  message: {
    to: ["88018XXXXXXXX"],
    message: "MiMSMS test message",
    senderId: "MiM SMS",
  },
  config: {
    username: "[email protected]",
    apiKey: "your_mimsms_key",
    transactionType: "T",
    campaignId: null,
  },
});
import { sendSms } from "sms-kit";

// sms.net.bd (Alpha SMS)
await sendSms({
  provider: "smsnetbd",
  message: {
    to: ["8801800000000", "8801700000000"],
    message: "sms.net.bd test message",
    senderId: "MyBrand",
  },
  config: {
    apiKey: "your_smsnetbd_key",
    schedule: "2021-10-13 16:00:52",
  },
});
import { sendSms } from "sms-kit";

// BulkSMSBD
await sendSms({
  provider: "bulksmsbd",
  message: {
    to: ["88017XXXXXXXX"],
    message: "BulkSMSBD test message",
    senderId: "8809617626719",
  },
  config: {
    apiKey: "your_bulksmsbd_key",
  },
});
import { sendSms } from "sms-kit";

// Automas
await sendSms({
  provider: "automas",
  message: {
    to: ["8801700000000", "8801800000000"],
    message: "Hello from Automas",
    senderId: "AUTOMAS",
  },
  config: {
    apiKey: "your_automas_key",
  },
});

License

This package is open-source and available under the MIT License.