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

geek-sms

v1.0.0

Published

SMS SDK for Javascript

Readme

Geek SMS

NPM

dependencies Status devDependencies Status GeekSMS Coverage Status Build Status PRs Welcome npm type definitions

A javascript library that supports multiple Vietnamese SMS service provider APIs.

Supported services

If you really need a service above or another else, you can push us by creating an issue or make a PR. We are very welcome your contributions.

Getting Started

Installation

yarn add geek-sms
// or
npm install --save geek-sms

Usage

import { ESMS } from 'geek-sms'

const esms = new ESMS(
  {
    API_KEY: 'AN_API_KEY',
    SECRET_KEY: 'A_SECRET_KEY',
  },
  {
    loglevel: 'trace',
  },
)

esms.getBalance()
esms.getBrandNameList()
esms.sendMessage(messageInfo)

Running the tests

Run tests once

yarn test
// or
npm run test

Run tests in watch mode

yarn test:watch
// or
npm run test:watch

API Reference

The documentation below is written in ECMAScript 6. If you have any issue please create an issue so we can help.

eSMS.vn

Initialize a new instance

new ESMS(
  {
    API_KEY, // Your API key.
    SECRET_KEY, // Your secret key.
  },
  {
    loglevel, // Could be one of 'trace', 'error', 'debug', 'info', 'silent'. Defaults to 'silent'.
    baseUrl, // Overrides eSMS API URL (w/o trailing slash (`/`)).
    useHttp, // Default API URL is https. Set this value to `true` if you want to use http.
  },
)

Example:

import { ESMS } from 'geek-sms'

const esms = new ESMS(
  {
    API_KEY: 'AN_API_KEY',
    SECRET_KEY: 'A_SECRET_KEY',
  },
  {
    loglevel: 'trace',
    baseUrl: 'http://another-url.esms.vn/MainService.svc/json',
  },
)

Get account balance

Returns the remaining money in your account.

Example:

const balance = await esms.getBalance()
// => 4000000

Get brand name list

Returns the list of registered brand names.

Example:

const brandnames = await esms.getBrandNameList()

/* Resolves
[ { name: 'QCAO_ONLINE', type: 2 },
  { name: 'STORELAMMOC', type: 1 },
  { name: 'STORELAMMOC', type: 2 } ]
*/

Send SMS message(s)

const messageInfo = {
  phone: '0979000001', // A list of numbers to send SMS.
  message: 'Test message jest',
  type: ESMSMessageType,
  brandName: 'STORELAMMOC',
  sandBox: true,
}

await esms.sendMessage(messageInfo)

// with
enum ESMSMessageType {
  /** Advertising message using brand name (send to >= 20 numbers). */
  AdvertisingBrandName = 1,
  /** Customer care message using brand name (send to 1 or more numbers). */
  CustomerCareBrandName = 2,
  /** For both advertising or customer care, using a static phone number to send. */
  StaticNumber = 4,
  /** Static 6394 number. Used for customer care or confirmation. */
  StaticConfirmation = 6,
  /** Use a static 10-digit number for customer care. Must registry message content first. */
  Static10Digit = 8,
}

/* Resolves
{
  id: '871a70d0-0c6c-4b47-9664-5745603da2d0169',
  phone: '0979000001',
  message: 'Test message jest',
  type: 2,
  brandName: 'STORELAMMOC',
  sandBox: true,
}
*/

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details