Skip to content
development
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

notifier-client

Simple client for https://github.com/DemocracyOS/notifier, forked from likeastore

Usage

Install from npm,

$ npm install notifier-client

Initialize the client,

var notifier = require('notifier-client')({
	url: 'http://notifier.example.com/api/events',
	token: 'your-custom-token'
});

Use the notify method,

notifier.notify({
	event: 'user-resistered',
	user: 'a@a.com',
	data: {registered: new Date() }
}, function () {
	// notified!
});

Or use to and withData methods,

notifier.notify('user-registered')
	.to('a@a.com')
	.withData({registered: new Date() })
	.send(function () {
		// notified!
	});

In both cases callback parameter is optional,

notifier.notify({
	event: 'user-resistered',
	user: 'a@a.com',
	data: {registered: new Date() });

// or

notifier.notify('user-registered')
	.to('a@a.com')
	.withData({registered: new Date() })
	.send();

TODOS

  • Tests

License

MIT

You can’t perform that action at this time.