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

node-magnetise

v0.0.8

Published

NodeJS Client for the http://magneti.se SMS message API

Downloads

5

Readme

Magnetise client for NodeJS

NPM version
Build Status Codeship Status Dependency Status Coverage Status

NPM NPM

Getting started

Our RESTful SMS message API can enable any application to send SMS messages to recipients.

Using an API client with the SMS message API

The simplest way for an application to use the SMS API, is for it to use one of the pre‑built API Clients. If there isn't a suitable API client for the application then it can call the SMS API directly.

Integrating an API client

First make sure that the applications development environment is setup with a suitable package manager.

Once the environment is set up and ready, install the API client

In your terminal run

$ npm install node-magnetise --save

Once the API client has been installed the application can begin sending SMS messages through the SMS message API with code similar to the following

var magnetise = require('node-magnetise').Client( 'your-api-key' );

magnetise.send( "Console", "+4405555889993", "SMS integration - done!", "Testing, campaign 2" )
  .on( 'success', function( data ) {
    console.info( 'send:', data );
  })
  .on( 'error', function( err ) {
    console.error( 'error:', err );
  });

Find out more about using the API clients.

Responses from the SMS message API

When sending an SMS message the SMS API will return a 202 indicating we’ve received the request and are processing it. It will also return the following information

// HTTP POST from API

{
  "to": "4405555889993",                                  // number to which the SMS message was sent
  "from": "A Test",                                       // the sent from number or label
  "message": "SMS integraion - done!",                    // the text content that was received
  "received": "2014-06-18T15:04:00.3799301Z",             // date and time the SMS message was received
  "live": true,                                           // indicates if live API Key was used
  "messageid": "813bbeda-d8ba-4085-a921-2b16b280284d",    // unique id of the message
  "tags": "Testing, campaign 2"                           // the tags given to the message
}

SMS messages are sent asynchronously so delays by mobile operators do not impact the running of the application. It is possible to configure a callback for delivery notifications so that the application can track when SMS messages are delivered. We provide the messageid from the initial response within all callbacks to the application so that it can track each SMS message individually.