Is there any Node.js client library to make OAuth and OAuth2 API calls to Twitter, Facebook, Google, LinkedIn, etc.?

pavanlimo picture pavanlimo · Jan 15, 2014 · Viewed 16.9k times · Source

I did a lot of googling and the best I could find was: https://github.com/ciaranj/node-oauth

Are there any libraries on top of this, which provide wrappers to make API calls to Twitter, Facebook, Google, LinkedIn, etc. to say post a tweet or DM somebody or get friends list or post a link to Facebook/G+ et al.?

I'm aware of Passport.js, but its usage is limited to obtaining authentication and authorization from these social sites. Beyond that, currently we will have to individualize API calls via node-oauth to perform activities mentioned above.

Have I missed something? Are you aware of any such libraries?

Answer

Jared Hanson picture Jared Hanson · Jan 16, 2014

Once you have used Passport.js to obtain an access token, I recommend (and personally use) request to make all API calls to third-party services.

In my opinion, provider-specific wrappers just add unnecessary complication. Most RESTful APIs are very simple HTTP requests. Extra layers only get in the way and add bugs to track down. Further, by sticking with request, you can integrate with any third party using the same, familiar module.