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 🙏

© 2024 – Pkg Stats / Ryan Hefner

micro-app-notify-client

v0.0.2

Published

client to send notifications though sms and other means

Downloads

9

Readme

micro-app-notify-client

Simple client to send notifications through SMS and other means.

The client currently supports sending notifications through the following:

The option of using the MqttSMSBridge server is nice because access control is handled by limiting access to the mqtt server. This means you don't need to have SMS provider information (ex Twilio auth info) deployed with your application. It also means you can centralize control over how you get notifications. For example, if you want to change the number to which notificaitons are sent, you only have to change the configuration for the bridge as opposed to having to reconfigure all applications that send notifications.

Usage

To send a notification simply call sendNotification. For example:

notify.sendNotification(config, message);

where:

  • config - an object with the configuration elements as specified in the configuration setion.
  • message - a string with the message to be sent.

Configuration

Configuration for the notify client is done through a notify element within the configuration object. That element can optionally include the following provider elements:

  • mqttSmsBridge
  • voipms
  • twilio

If an element is absent, then that provider is not used for notifications. If the element is present then it should have a field called enabled. If the value for this field is true then a notification will be sent using that provider.

The options for each of the provider elements are:

  • mqttSmsBridge

    • enabled - set to true if you want notifications to be sent using this provider.
    • serverUrl - url for the mqtt server to which the bridge is connected.
    • topic - topic on which the bridge listens for notification requests.
    • certs - directory which contains the keys/certs required to connect to the mqtt server if the url is of type mqtts.
  • voipms

    • enabled - set to true if you want notifications to be sent using this provider.
    • user - voip.ms API userid.
    • password - voip.ms API password.
    • did - voip.ms did(number) from which the SMS will be sent.
    • dst - number to which the SMS will be sent.
  • twilio

    • enabled - set to true if you want notifications to be sent using this provider.
    • accountSID - twilio account ID.
    • accountAuthToken - twilio auth token.
    • toNumber - number to which the SMS will be sent.
    • fromNumber - number from which the SMS will be sent.

An example of a json file that can be read in to make the configuration object (with the sensitive bits masked):

{
  "notify": {
    "mqttSmsBridge": { "enabled": true,
                       "serverUrl": "mqtts:xxxxxxxxxxxxx:8883",
                       "topic": "house/sms",
                       "certs": "certs-outside" },
    "voipms": { "enabled": false,
                "user": "xxxxxxxxxxx",
                "password": "xxxxxxxx",
                "did": "xxxxxxxxxx",
                "dst": "xxxxxxxxxx" },
    "twilio": { "enabled": false,
                "accountSID": "XXXXXXXXXXXXXXXXXXXXXXXXXX",
                "accountAuthToken": "XXXXXXXXXXXXXXXXXXX",
                "toNumber": "XXXXXXXXXXX" ,
                "fromNumber": "XXXXXXXXXX" }
  }
}

Installation

Install by running:

npm install micro-app-notify-client

or

npm install https://github.com/mhdawson/micro-app-notify-client.git