A javascript wrapper for the Splitwise API.
Install with npm
npm install splitwise-node
- 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(({ token, secret }) => {
[userOAuthToken, userOAuthTokenSecret] = [token, secret];
return api.getUserAuthorisationUrl(token);
});
var splitwiseApi = authApi.getSplitwiseApi(userOAuthToken, userOAuthTokenSecret);