<commit_before>maygaserver-nodejs
==================
A nodejs wrapper for mayga (mayga.me) messaging API to enable in app messaging

Installation Instructions :
===========================

Download and Install lib/maygaserver.js in your lib

or

use "npm install maygaserver -g"

Usage :
=======
if installed by downloading the file

var maygaserver = require('./lib/maygaserver');

for NPM based install

var maygaserver = require('maygaserver');

maygaserver.initialize(credentials, options);

(required) credentials :
        (required) clientId from mayga.me
        (required) clientSecret from mayga.me

(optional) options :
	(optional) debugOn = true / false
        (optional) server = restify or express server object
        (optional) endpoint = endpoint url to expose this api default : /integration/mayga/getToken/:userEmail

List of API's supported by the library.
=======================================

###Add a new User

        maygaserver.addNewAppUser(userEmail,callback)

###Get Authroization Token for server side integration

        maygaserver.getAuthToken(callback);


###Get Authroization Token on behalf of the user for client side integration

        maygaserver.getUserToken(email, callback);

###Example :

maygaserver.initialize({clientId:"abcdeg",clientSecret:"qwerty"},{debugOn:true});

maygaserver.addNewAppUser("<EMAIL>",function(err,user) {
        console.dir(user);
        mayga.getUserToken("<EMAIL>",function(err,token) {
                console.dir(token);
        });
});
<commit_msg>updated the docs and usage<commit_after>maygaserver-nodejs
==================
A nodejs wrapper for mayga (mayga.me) messaging API to enable in app messaging

Installation Instructions :
===========================

Download and Install lib/maygaserver.js in your lib

or

use "npm install maygaserver -g"

Usage :
=======
if installed by downloading the file

	var maygaserver = require('./lib/maygaserver');

for NPM based install

	var maygaserver = require('maygaserver');

	maygaserver.initialize(credentials, options);

(required) credentials :
        (required) clientId from mayga.me
        (required) clientSecret from mayga.me

(optional) options :
	(optional) debugOn = true / false
        (optional) server = restify or express server object
        (optional) endpoint = endpoint url to expose this api default : /integration/mayga/getToken/:userEmail

List of API's supported by the library.
=======================================

###Add a new User

        maygaserver.addNewAppUser(userEmail,callback)

###Get Authroization Token for server side integration

        maygaserver.getAuthToken(callback);


###Get Authroization Token on behalf of the user for client side integration

        maygaserver.getUserToken(email, callback);

###Example :

	maygaserver.initialize({clientId:"abcdeg",clientSecret:"qwerty"},{debugOn:true});
	maygaserver.addNewAppUser("<EMAIL>",function(err,user) {
        	console.dir(user);
        	mayga.getUserToken("<EMAIL>",function(err,token) {
                	console.dir(token);
        	});
	});

{'fraction_non_alphanumeric': 0.1517509727626459, 'fraction_numerical': 0.0, 'mean_word_length': 4.282534246575342, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3414452', 'n_tokens_mistral': 896, 'n_tokens_neox': 859, 'n_words': 246}