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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@anisafifi/sms-kit

v0.0.1

Published

An easy-to-use SMS sender for Bangladesh

Readme

SMS Kit - A Simple Bulk SMS Sender

A simple and easy-to-use SMS sender package for Bangladesh. The package allows you to send SMS messages using an API and can automatically grab API credentials from environment variables.

Installation

npm install @anisafifi/sms-kit

Importing the Module

import { sendSms } from "@anisafifi/sms-kit";

Usage

You can use the package to send SMS messages by calling the sendSms function. This function accepts the following parameters:

sendSms function

sendSms({
  recipientNumbers: string[],  // Array of recipient phone numbers (in international format, e.g., '+8801712345678')
  message: string,             // The message to be sent
  apiKey?: string,             // Your API key (optional, will use environment variable if not provided)
  apiUrl?: string,             // The API URL (optional, will use environment variable if not provided)
  senderId?: string            // The sender ID (optional, will use environment variable if not provided)
});

Example:

import { sendSms } from "@anisafifi/sms-kit";

// Send an SMS message
sendSms({
  recipientNumbers: ['+8801712345678'],
  message: 'Hello from SMS Kit!'
}).then(response => {
  console.log('SMS Response:', response);
}).catch(error => {
  console.error('Error:', error);
});

Environment Variables

The following environment variables are supported and will be automatically used if not passed explicitly to the sendSms function:

  • SMS_API_KEY: The API key for your SMS provider.
  • SMS_API_URL: The API URL for the SMS provider's endpoint.
  • SMS_API_SENDER_ID: The sender ID you wish to use for sending the SMS.

You can define these variables in your .env file or directly in your environment.

Example .env file:

SMS_API_KEY=your_api_key
SMS_API_URL=https://api.smsprovider.com
SMS_API_SENDER_ID=YourSenderID

Make sure to install dotenv to load the environment variables if you're using a .env file:

npm install dotenv

or you can use any other package that will handle .env file.

Then, in your code:

import dotenv from 'dotenv';
dotenv.config();

// Now you can use sendSms as usual
sendSms({
  recipientNumbers: ['8801*********'],
  message: 'Hello from SMS Kit!'
}).then(response => {
  console.log('SMS Response:', response);
}).catch(error => {
  console.error('Error:', error);
});

Error Handling

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

{
  success: boolean;
  data?: any;
  error?: string;
}
  • 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"
}

Configuration Options

You can provide the following configuration options when calling sendSms:

  • recipientNumbers: A list of phone numbers (strings) to send the SMS to. The numbers should be in international format (e.g., +8801712345678).
  • message: The content of the message you want to send.
  • apiKey: (Optional) The API key for the SMS provider. If not provided, it will be fetched from the environment variable SMS_API_KEY.
  • apiUrl: (Optional) The API URL for the SMS provider. If not provided, it will be fetched from the environment variable SMS_API_URL.
  • senderId: (Optional) The sender ID to be used for sending the SMS. If not provided, it will be fetched from the environment variable SMS_API_SENDER_ID.

License

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