Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

notifuse

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

notifuse

NodeJS client to interact with the Notifuse.com API.

  • 1.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

Node library for the Notifuse API

Notifuse connects all your notification channels (SenGrid, Mailgun, Twilio SMS, Slack, push...) to a powerful API/platform that handles templating, contacts segmentation and smart campaigns.

We recommend you to read the API Reference to understand the behavior and results of every methods.

Installation

npm install notifuse --save

Usage

var Notifuse = require('notifuse'),
    client = new Notifuse.Client(API_KEY, options);

Client options

KeyExpected value.
timeoutRequest timeout in ms. Default 5000.
maxAttemptsMax retry attempts. Default 5.
retryDelayDelay between retry attempts in ms. Default 250.
agentHttps agent for the requests.

Upsert contacts


// upsert an array of contacts

var myContact = {
  id: '123',
  profile: {
    $set: {
      firstName: 'John',
      lastName: 'Doe'
    }
  }  
};

client.contacts.upsert([myContact], function(error, result){
  if (error) {
   // handle error
  }

  // result example:
  // { 
  //   statusCode: 200,
  //   success: true,
  //   inserted: [],
  //   updated: ['123'],
  //   failed: []
  // }

});

// same with a promise

client.contacts.upsert([myContact]).then(function(result){

})
.catch(function(error){

});

Send messages


var Notifuse = require('notifuse'),
    client = new Notifuse.Client(API_KEY);

var myMessage = {
  notification: 'welcome',
  channel: 'sendgrid-acme',
  template: 'v1',
  contact: '123',
  contactProfile: {
    $set: {
      firstName: 'John',
      lastName: 'Doe'
    }
  },
  templateData: {
    _verificationToken: 'xxx'
  } 
};

client.messages.send([myMessage], function(error, result){
  if (error) {
   // handle error
  }

  // result example:
  // { 
  //   statusCode: 200,
  //   success: true,
  //   queued: [{ ... }],
  //   failed: []
  // }

});

// same with a promise

client.messages.send([myMessage]).then(function(result){

})
.catch(function(error){

});

Retrieve a message


var Notifuse = require('notifuse'),
    client = new Notifuse.Client(API_KEY);

var myMessageId = 'xxxxxxxxxxxxxxxx';

client.messages.info(myMessageId, function(error, result){
  if (error) {
   // handle error
  }

  // result is a message object defined in the API Reference
});

// same with a promise

client.messages.info([myMessage]).then(function(result){

})
.catch(function(error){

});

Support

Feel free to create a new Github issue if it concerns this library, otherwise use our contact form.

Copyright © Notifuse, Inc. MIT License; see LICENSE for further details.

Keywords

FAQs

Package last updated on 03 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc