You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

linkedin-node-new

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

linkedin-node-new

A NodeJS connector for LinkedIn OAuth2

0.0.4
Source
npmnpm
Version published
Weekly downloads
1
-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

LinkedIn Node

npm install linkedin-node-new

You can run the test by cloning this repo and running:

npm install
node test/test

For setting up:

var linkedInObj = require('linkedin-node-new');

var linkedIn = new linkedInObj({
  id: 'MYCLIENTID',
  secret: 'MYCLIENTSECRET',
  scope: '', // optional, set the scope of your app
  redirect_uri: 'http://localhost:9000/#!/oauth/linkedin'
});

var url = linkedIn.createURL();

After you have obtained the 'code' (either via your redirect or elsewhere):

var code = ''; // put the short-time auth code in here.

linkedIn.getAccessToken(code, function(err, access_token) {
	console.log(err);
	console.log(access_token);
});

If you have saved your access token in some sort of session or cookie data, you can skip the authorization request:

var linkedIn = new linkedInObj({
  id: 'MYCLIENTID',
  secret: 'MYCLIENTSECRET',
  redirect_uri: 'http://localhost:9000/#!/oauth/linkedin',
  access_token: 'MYACCESSTOKEN'
});

Once authorized, you can perform typical REST services (https://developer.linkedin.com/documents/authentication for reference):

// GET
linkedIn.get('/v1/people/~:(id,first-name,last-name,headline,positions,picture-url,email-address)', function(err, res) {
  if(err) {
    return console.log(err);
  }

  console.log(res);
  console.log(res.positions.values[0]);
});

// POST

// PUT

// DELETE

Built in Ohio. www.typefoo.com

FAQs

Package last updated on 15 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts