microsoftarchive / wunderlist.js

Wunderlist Javascript SDK
https://developer.wunderlist.com/documentation/tools/wunderlist.js
120 stars 29 forks source link

Ability to provide access token on a service call #15

Open dev-tim opened 7 years ago

dev-tim commented 7 years ago

Hello folks!

At the moment I'm curious if it's possible to provide access token when calling specific API resource. For example:

var wunderlistAPI = new WunderlistSDK({
  'accessToken': 'a user access_token',
  'clientID': 'client_id'
});

wunderlistAPI.http.lists.all()

will return lists for a user who owns access token that we passed to the WunderlistSDK constructor.

I'd like to use this library on the server side, but it seems to be a bit of overkill to recreate WunderlistSDK instance on each call. Instead it would be cool to see something like:

var wunderlistAPI = new WunderlistSDK({
  'clientID': 'client_id'
});

wunderlistAPI.http.lists.all(accessToken)

so it would be possible to re-use wunderlistAPI instance serving requests for different users.