f1-node-api
v1.0.1
Published
A wrapper around Fellowship One's API. Let's make this easier
Downloads
3
Maintainers
Readme
f1-node-api
A node wrapper for the Fellowship One API. There needed to be an easier way of interfacing with the existing api.
Todo
- Need to hookup OAuth strategy. Might use a headless browser to handle this, so I can keep it in the same wheelhouse.
Usage
npm install f1-node-api
If you set process.env.DEVELOPMENT
all requests will hit against staging.fellowshiponeapi.com;
Available endpoints: api_path.json
var fOne = require('f1-node-api');
// Returns a Fellowship One endpoint by passing a churchcode and desired route
// Example: fOne.createEndpoint('foo','households_search')
// https://foo.fellowshiponeapi.com/v1/Households/Search.json
fOne.createEndpoint(churchcode, route);
// Creates a request to Fellowship One
// @params obj {Object}
// obj = {path: '', params:'', oauth: {token:'', token_secret:'',consumer_key:'',consumer_secret:''}, churchcode:''}
// @params callback {Function}
//
// TODO: convert to using streams
fOne.f1_request(obj, callback);