splitwise-node
v0.3.3
Published
A javascript wrapper for the Splitwise API
Downloads
6
Readme
splitwise-node
A javascript wrapper for the Splitwise API.
Install with npm
npm install splitwise-node
Usage
- Get your ConsumerToken and ConsumerSecret from Splitwise
- Get an authorization url to send your user to:
var AuthApi = require('splitwise-node');
var userOAuthToken, userOAuthTokenSecret;
var authApi = new AuthApi(ConsumerKey, ConsumerSecret);
var userAuthUrl = authApi.getOAuthRequestToken()
.then(({ oAuthToken, oAuthTokenSecret }) => {
[userOAuthToken, userOAuthTokenSecret] = [oAuthToken, oAuthTokenSecret];
return api.getUserAuthorisationUrl(oAuthToken);
});
- Get your user to authorize your token by visiting the authorization url
- Now you can api away
var splitwiseApi = authApi.getSplitwiseApi(userOAuthToken, userOAuthTokenSecret);