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

venn-messaging

v0.3.2

Published

Venn Messaging Redundancy Package, including Push Notifications, Email and SMS

Downloads

41

Readme

Venn Email

Codeship Status for VennHQ/venn-email-node

Build in a redundant messaging service seamlessly. If your email, sms or push notification provider goes down, we'll fall back to a secondary service.

Installation

npm install venn-messaging

Email

initialize(api_key)

|params |type |description |example | |--------|-------|-------------|-------------------------| |api_key |String |Venn API Key |64d2fa24h3f6f7cc61asp3e8 |

send(data, callback)

|params |type |description |example | |-------------|-------|-------------------|---------------| |data.from |String |from email address |[email protected] | |data.to |String |to email address |[email protected] | |data.subject |String |email subject |Subject 123 | |data.message |String |email message |How you doin? |

Example

vennEmail = require("venn-messaging").Email;

// initialize and send an email
vennEmail.initialize(VENN_API_KEY);

var data = {
	from: "[email protected]",
	to: "[email protected]",
	subject: "Subject 123",
	message: "How you doin?"
};

vennEmail.send(data, function(err, result){
	// email successfully sent if no error
});

SMS

initialize(api_key)

|params |type |description |example | |--------|-------|-------------|-------------------------| |api_key |String |Venn API Key |64d2fa24h3f6f7cc61asp3e8 |

send(data, callback)

|params |type |description |example | |-------------|-------|------------------|--------------| |data.from |String |from phone number |+14354402246 | |data.to |String |to phone number |+1633050227 | |data.message |String |text message |How you doin? |

Example

vennSms = require("venn-messaging").SMS;

// initialize and send an SMS
vennSms.initialize(VENN_API_KEY);

var data = {
	from: "+14356650499",
	to: "+14503350029",
	message: "How you doin?"
};

vennSms.send(data, function (err, result) {
	// text successfully sent if no error
});

Push Notification

initialize(api_key)

|params |type |description |example | |--------|-------|-------------|-------------------------| |api_key |String |Venn API Key |64d2fa24h3f6f7cc61asp3e8 |

send(data, callback)

|params |type |description |example | |-----------------|-------|----------------------|-----------------------------| |data.deviceToken |String |id of target device |FE66489F304DC75B8D6E8200DFF8 | |data.deviceType |String |type of target device |ios | |data.message |String |notification message |How you doin? |

Example

vennPush = require("venn-messaging").Push;

// initialize and send a push notification
vennPush.initialize(VENN_API_KEY);

var data = {
	deviceToken: "FE66489F304DC75B8D6E8200DFF8",
    deviceType: "ios",
    message: "How you doin?"
};

vennPush.send(data, function (err, result) {
	// push notification successfully sent if no error
});

Development

Install Dependencies

npm install

Export Environment Variables

VENN_API_KEY="h41fa6602663b30c78b9c339"
VENN_API_URL="http://localhost:3400/v1"

Run Examples

node examples/example.js 

Run Examples with Debugging

VENN_API_KEY=5f6abf85d1947ce29ce7332f
VENN_API_URL=http://localhost:3400/v1
DEBUG="venn"
node examples/example.js

Run Tests

mocha

Adding a New Service Provider

  1. Write Failing Tests
  2. Create a new test file of the form test/service_type/service_name/error.js
  3. Copy test/template/test_service_template.js into this new file
  4. Follow instructions in the template file to create tests for the new service
  5. Create the New Service Provider
  6. Install the service provider's npm package as a dependency
  7. Create a new file of the form lib/models/providers/service_type/service_name.js
  8. Copy lib/models/providers/template/service_template.js into this new file
  9. Follow instructions in the template file to create the new service
  10. Edit lib/models/messaging_client.js
  11. Require the newly created service provider
var ServiceName = require('./providers/service_type/service_name');
  1. Add the newly created service provider to initServices
else if (property === "service_name" && keys[property]) {
	messagingProvider = new ServiceName(keys[property]);
}
  1. Add api key validator to Venn API