This repository contains the open source NodeJS SDK that allows you to access the Appsaholic platform from your NodeJS application.
npm install appsaholic-sdk --save
Minimal example:
var Appsaholic = require('appsaholic-sdk'),
Session = Appsaholic.Session,
User = Appsaholic.User;
var session = new Session('API_KEY', 'API_SECRET', 'e8d90954-8ce7-498e-96f3-cac57f54e524');
var points = new Point(session);
// Immediately add 100 points to the users account
points.add(100).then(function(referenceId) {
// Log the referenceId, print it out, etc.
});
See the examples
directory for numerous usages.
If you'd like to contribute to this package, please be sure to checkout the contributing guide before getting started.
To start developing for this package:
-
Clone the repository to your machine
-
Navigate to the main folder within your shell
-
Install all the dependencies for the package
npm install
-
Install Gulp globally if you haven't already (optional)
npm install gulp -g
-
Run
gulp
, or if you don't want to install globally run./node_modules/.bin/gulp
Running gulp
or gulp default
will watch the source files, and upon saved changes will automatically run the code through ESLint as well as run the unit tests.
If you don't want to use Gulp at all, you can run the following included commands for testing and development:
Unit Tests
npm test
Linting
npm lint
Coverage
npm cover