npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nr-linkedin-login

v1.0.2

Published

A cordova linkedin plugin with native login style

Readme

LinkedIn

$ cordova plugin add  https://github.com/nithinkumarhere/nr-cordova-linkedin.git --variable APP_ID=YOUR_APP_ID
$ npm install --save nr-linkedin-login

[Usage Documentation]

Plugin Repo: https://github.com/nithinkumarhere/nr-cordova-linkedin

A Cordova plugin that lets you use LinkedIn Native SDKs for Android and iOS.

Please see the plugin's repo for detailed installation steps.

Supported platforms

  • Android
  • iOS

Usage for Linkedin Login for Native

import { LinkedIn } from '@ionic-native/linkedin';

constructor(private linkedin: LinkedIn) { }

...

// check if there is an active session
this.linkedin.hasActiveSession().then((active) => console.log('has active session?', active));

// login
const scopes = ['r_basicprofile', 'r_emailaddress', 'rw_company_admin', 'w_share'];
this.linkedin.login(scopes, true)
  .then(() => console.log('Logged in!')
  .catch(e => console.log('Error logging in', e));


// get connections
this.linkedin.getRequest('people/~')
  .then(res => console.log(res))
  .catch(e => console.log(e));

// share something on profile
const body = {
  comment: 'Hello world!',
  visibility: {
    code: 'anyone'
  }
};

this.linkedin.postRequest('~/shares', body)
  .then(res => console.log(res))
  .catch(e => console.log(e));

Linkedin Login for In-App-Browser in case Linkedin App is not installed

Installing

From the root of your Apache Cordova project, execute the following:

npm install nr-linkedin-browser --save

This will install nr-linkedin-browser and its dependencies.

Injecting:

There are 2 types of entities in the library: Platform (i.e., Cordova, Browser) and Provider (i.e., Facebook, LinkedIn, etc.). Each provider has it's own class. You need to inject the Platform class into every class in which you wish to use them. For example, if you wish to use Facebook oauth in a particular class, it would look something like:

import {LinkedInb} from 'nr-linkedin-browser/core';
import {OauthBrowser} from 'nr-linkedin-browser/platform/browser'
// or
import {OauthCordova} from 'nr-linkedin-browser/platform/cordova'

Alternatively you can use Angular2 Injector in order to provide platform specific service for all components:

import {bootstrap} from '@angular/platform-browser-dynamic'
import {App} from './app.component'
import {OauthCordova} from 'nr-linkedin-browser/platform/cordova'
import {Oauth} from 'nr-linkedin-browser/oauth'

bootstrap(App, [
  { provide: Oauth, useClass: OauthCordova }
])

// and later in component

@Component({
  selector: 'my-component'
})
class MyComponent {
  constructor(oauth: Oauth) {
    this.oauth = oauth
  }
}

Using nr-linkedin-browser In Your Project

const provider = new LinkedInb({
    clientId: string,
    appScope?: string[],
    redirectUri?: string,
    responseType?: string,
    authType?: string
});

A Working Example with both Native & In-App-Browser, If Linkedin App is not installed locally it should trigger In-App-Browser login.

import { Component, OnInit } from '@angular/core';
import { NavController, Platform } from 'ionic-angular';
import { LinkedIn, LinkedInLoginScopes } from 'nr-linkedin';
import { LinkedInb } from "nr-linkedin-browser/core";
import {OauthCordova} from 'nr-linkedin-browser/platform/cordova';
@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage implements OnInit {

private loggedIn: boolean;
  scopes: LinkedInLoginScopes[] = ['r_basicprofile', 'r_emailaddress', 'rw_company_admin', 'w_share'];
  isLoggedIn: boolean = false;
  selfData = { id:"", firstName:"", lastName:"" };

  private oauth: OauthCordova = new OauthCordova();
  private linkedinbProvider: LinkedInb = new LinkedInb({
    clientId: "814imsl6ap5wcn",
    appScope: ["r_basicprofile","r_emailaddress"],
    redirectUri: "http://localhost/callback",
    responseType: "code",
    state: "DCEeFWf45A53sdfKef424"
  })
   constructor(public navCtrl: NavController, private linkedin: LinkedIn, private platform: Platform) {}
   public linkedinb() {
    this.platform.ready().then(() => {
        this.oauth.logInVia(this.linkedinbProvider).then(success => {
            console.log("RESULT: " + JSON.stringify(success));

        }, error => {
            console.log("ERROR: ", error);
        });
    });
}
  ngOnInit() {

  }

  ionViewDidAppear() {
    this.linkedin.hasActiveSession().then((active) => {
      this.isLoggedIn = active;
      if(this.isLoggedIn === true) {
        this.getSelfData();
      }
    });
  }


  login(){
  this.linkedin.isLinkedInAppInstalled()
  .then(res => {
    if(res==false){
      console.log("app not installed");
      this.linkedinb();
    }else{
      console.log("app installed");
      this.linkedin.login(this.scopes, true)
      .then(() => {
        this.isLoggedIn = true;
        this.getSelfData();
      })
      .catch(e => console.log('Error logging in', e));
    }
  })
  .catch(e => console.log(e));
}



  logout() {
    this.linkedin.logout();
    this.isLoggedIn = false;
    console.log(this.isLoggedIn);
  }

  getSelfData() {
    this.linkedin.getRequest('people/~')
      .then(res => {
        this.selfData = res;
        //this.openProfile(res.id);
        console.log(res);
      })
      .catch(e => console.log(e));
  }

  openProfile(memberId) {
    this.linkedin.openProfile(memberId)
      .then(res => console.log(res))
      .catch(e => console.log(e));
  }

  shareSomething() {
    const body = {
      comment: 'May I Share something on my profile?',
      visibility: {
        code: 'anyone'
      }
    };

    this.linkedin.postRequest('~/shares', body)
      .then(res => console.log(res))
      .catch(e => console.log(e));
  }
}