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'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); });
https://www.npmjs.com/package/node-linkedin is the officially supported library.
v2.0
branch on the repo but it's far from complete and undocumented. –
Example Check this out.
I implemented this using some available help from the internet.
Works like a charm. Just follow the instructions in the README.
https://github.com/imjuoy/SignIn-With-LinkedIn
Also ensure that you setup your API Key, API Key secret and callback URL at developers.linkedin.com before you run the application.
Remember to replace the callback URL in the server.js
http://github.com/ciaranj/node-oauth/tree/master/examples has some examples for another service that uses OAuth. YMMV.
https://github.com/eilonmore/linkedin-private-api
You can basically do everything with it.
Note: it doesn't use the official API of LinkedIn.
© 2022 - 2024 — McMap. All rights reserved.