frontapp-node
v0.0.4
Published
FrontApp Node.js API Wrapper
Downloads
1
Readme
frontapp
FrontApp Node.js API Wrapper
Installation
npm install frontapp-node
Testing
npm test
Running the code locally
Compile using babel:
gulp babel
Require FrontApp:
var FrontApp = require('./dist/index');
Usage
Require FrontApp:
var FrontApp = require('frontapp-node');
Create a client:
Using Personal Access Tokens
var client = new FrontApp.Client('token');
Callbacks
This client library supports two kinds of callbacks:
client.analytics.get({}, function (err, r) {
// err is an error response object, or null
// r is a successful response object, or null
});
Promises
This client library also supports using Promises instead of callbacks:
client.analytics.get({}).then(function (r) {
// ...
});
Analytics
// To get statistics about activities happening in Front, you need to requests the correspondig metrics of the analytics.
client.analytics.get({
start: '',
end: '',
metrics: []
}, callback);