I'd like to do some LinkedIn API coding using node.js. Does anyone know of an example node.js application that implements the LinkedIn oauth?
thanks
I've been using node-linkedin
, very easy to setup, and you can do everything with it...It also looks a lot more promising than the answer with 5 votes.
Quick and easy setup example:
var Linkedin = require('node-linkedin')('app-id', 'secret'); // Get app-id + secret from your LinkedIn developer account
Initialise a linkedin class with a token, e.g an oauth2 token you received from your front-end. this.token = the token that was parsed to my api from the frontend.
var linkedin = Linkedin.init(this.token); // this.token = client token.
Here is a promised linkedin call that I'm using:
return new Promise( (fullfil, reject) => {
linkedin.people.me( (err, user) => {
console.log (user, "All user data attached to this.token");
let resp = {response: user, error: null};
if (err) resp = {response: null, error: err};
else {
this.email = user.emailAddress;
this.id = user.id;
}
fullfil(resp)
});
});
Without the promise it'd look like this:
linkedin.people.me( (err, user) => { console.log (user); });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With