keriwarr / splitwise Goto Github PK
View Code? Open in Web Editor NEWA JavaScript SDK for the Splitwise API.
License: MIT License
A JavaScript SDK for the Splitwise API.
License: MIT License
I'm trying to build a web app that makes use of Splitwise's API to be able to create debts for users of my app.
It appears as though using a client secret is required, so I can't use their API from my client side application. I'm implementing a server layer to do the communication with Splitwise's API for this reason and their website points to this library.
I'm attempting to use firebase functions for my server layer as such:
Whenever I hit this endpoint I get data from my account returned even though at no point was i shown an authorization screen. This is the case no matter which device I hit my endpoint from.
Is it the case that this library only provides access to the developers data? and that I can't enable users to access their own data through this library?
Describe the bug
I'm getting authentication errors when trying a very simple usage of this library.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Expected to see user object returned
Actual behavior
Error: authentication failed - unknown error
Snippets/stack-traces
Environment (please complete the following information):
Additional context
Add any other context about the problem here.
Current Usage
const sw = Splitwise({
consumerKey: {my_consumer_key},
consumerSecret: {my_consumer_secret},
logger: console.log
})
sw.getCurrentUser()
.then(user => console.log(user))
.catch(err => console.log(err))
Hello,
I'm struggling using this API for my project... at the very beginning :)
I initialised a new node project and added this package only. Now when running the basic example it returns Error: authentication failed - client error
I put in the consumer key and secret that was given to me, when I created my app in the Splitwise Dashboard.
Is this still supposed to work?
Thank you and have a great day everyone,
Hans
How to upload receipt image via sw.createExpense?
There is no documentation for this.
🚨 You need to enable Continuous Integration on all branches of this repository. 🚨
To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.
Since we didn’t receive a CI status on the greenkeeper/initial
branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.
If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/
.
Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial
branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.
Not sure what but receives the following return with [Object] in it, when calling sw.getExpenses({ group_id: group_id })
could you give me a pointer? thanks.
[ { id: 383272047, group_id: 1484568, friendship_id: null, expense_bundle_id: null, description: 'HBO Now', repeats: true, repeat_interval: 'monthly', email_reminder: false, email_reminder_in_advance: -1, next_repeat: '2018-06-20T04:00:00Z', details: null, comments_count: 0, payment: false, creation_method: 'equal', transaction_method: 'offline', transaction_confirmed: false, transaction_id: null, cost: '16.32', currency_code: 'USD', repayments: [ [Object], [Object], [Object], [Object], [Object], [Object], [Object] ], date: '2018-05-20T04:00:00Z', created_at: '2018-05-20T04:32:15Z', created_by: { id: 41211, first_name: 'Travis', last_name: 'Wu', picture: [Object] }, updated_at: '2018-05-20T04:32:15Z', updated_by: { id: 41211, first_name: 'Travis', last_name: 'Wu', picture: [Object] }, deleted_at: null, deleted_by: null, category: { id: 18, name: 'General' }, receipt: { large: null, original: null }, users: [ [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object] ] } ]
Getting the following error:
(node:9992) UnhandledPromiseRejectionWarning: Error: authentication failed - client error
oauth2.getOAuthAccessToken('',
{ grant_type: 'client_credentials' },
(_, token) => console.log(token)
);
Now, this will result { statusCode: 400, data: '{"error":"unsupported_grant_type"}' }
🚨 You need to enable Continuous Integration on all branches of this repository. 🚨
To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.
Since we didn’t receive a CI status on the greenkeeper/initial
branch, it’s possible that you don’t have CI set up yet. We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.
If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/
.
Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please delete the greenkeeper/initial
branch in this repository, and then remove and re-add this repository to the Greenkeeper App’s white list on Github. You'll find this list on your repo or organization’s settings page, under Installed GitHub Apps.
At spatie, We're now automatically adding our lunch order to our Splitwise group. Thanks to your repo, the Splitwise implementation was super easy! The documentation is comprehensive & extensive, thanks a bunch!
Maybe add an example of a createExpense
POST request to the docs? The one in Splitwise's API docs isn't completely clear either. I had to check the network tab of my Chrome dev tools while adding an expense to check what the form data had to look like.
Maybe I'll send a PR next week to add this myself :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.