New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@gcou/react-native-linkedin

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gcou/react-native-linkedin

React-Native LinkedIn, a simple LinkedIn login library for React-Native with WebView and Modal - compatibility with RN 0.73

latest
Source
npmnpm
Version
2.5.0
Version published
Maintainers
1
Created
Source

react-native-linkedin

🔗 React-Native LinkedIn

Simple LinkedIn login library for React-Native with WebView into a Modal


Benefits

  • Light: No need to link a native library like others alternatives
  • Simple: Get the token and the expires, you handle your own login with the access_token
  • Sure: open-source
  • Almost readable & understandable code: JavaScript & React

Installation

$ yarn add @gcou/react-native-linkedin

If your project uses expo >= 48, then you need to add expo-crypto to your project. The uuid library uses the Expo module if present. If Expo >= 48, then the crypto elements are in the expo-crypto module

$ yarn add expo-crypto

Security

Please note that you should give your linkedin client id but not your secret key to this component. You should be aware that key can be found if you store it directly to your code. I strongly recommend to not declare client secret key on your code but found a way to keep it secret

  <LinkedInModal
    shouldGetAccessToken={false}
    clientSecret={null}
    clientID="[ Your client id from https://www.linkedin.com/developer/apps ]"
    redirectUri="[ Your redirect uri set into https://www.linkedin.com/developer/apps ]"
    onSuccess={({ authentication_code }) => console.log(`Post this ${authentication_code} to your server.`)}
  />

Example

// See ./App.tsx file for details
import React, {ReactElement, useRef} from 'react';
import {StyleSheet, View} from 'react-native';

import LinkedInModal from 'react-native-linkedin';
import LinkedInModalRef from 'react-native-linkedin';

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    justifyContent: 'center',
    alignItems: 'center',
  },
})

export default function AppContainer() : ReactElement {
  linkedRef = useRef<LinkedInModalRef>(null);
  
  return (
    <View style={styles.container}>
      <LinkedInModal
        ref={this.linkedRef}
        clientID="[ Your client id from https://www.linkedin.com/developer/apps ]"
        clientSecret="[ Your client secret from https://www.linkedin.com/developer/apps ]"
        redirectUri="[ Your redirect uri set into https://www.linkedin.com/developer/apps ]"
        onSuccess={token => console.log(token)}
      />
      <Button title="Log Out" onPress={this.linkedRef.current.logoutAsync()} />
    </View>
  )
}

Props

NameTypeRequiredDefaultDescription
clientIDstringrequiredYour client id
clientSecretstringuse shouldGetAccessToken={false} and read authorization_code onSuccess returnShould not be stored in app WARNING! Your client secret
redirectUristringrequiredYour redirectUri
onSuccessfunctionrequiredFunction will be call back on success
authStatestringoptionalrequire('uuid').v4()The state of auth, to be more secure
onErrorfunctionoptionalconsole.error(err)Function will be call back on error
onClosefunctionoptionalFunction will be call back on close modal
onOpenfunctionoptionalFunction will be call back on open modal
onSignInfunctionoptionalFunction will be call back when the user sign in
permissionsstring[]optional'r_liteprofile', 'r_emailaddress'The LinkedIn access token permissions
renderButtonReactElementoptionalRender for customize LinkedIn button
renderCloseReactElementoptionalRender for customize close button
linkTextstringoptional'Login with LinkedIn'Link label
containerStyleStylePropoptionalCustomize container style
wrapperStyleStylePropoptionalCustomize wrapper style
closeStyleStylePropoptionalCustomize close style
animationTypeModal.propTypes.animationTypeoptionalfadeCustomize animationType style: 'none', 'slide' or 'fade'
shouldGetAccessTokenbooloptionaltrueSet to false to receive the 'authorization code' rather then the 'access token'
areaTouchTextobjectoptional{top: 20, bottom: 20, left: 50, right: 50}Set values for to increase the text touch area

Contribution

PRs are welcome!

FAQ

Is it supported and tested both on android and iOS?

YES

How to logout react-native-linkedin?

<View style={styles.container}>
    <LinkedInModal
      ref={this.linkedRef}
      clientID="[ Your client id from https://www.linkedin.com/developer/apps ]"
      clientSecret="[ Your client secret from https://www.linkedin.com/developer/apps ]"
      redirectUri="[ Your redirect uri set into https://www.linkedin.com/developer/apps ]"
      onSuccess={token => console.log(token)}
    />
    <Button title="Log Out" onPress={this.linkedRef.current.logoutAsync()} />
</View>

Alternatives

Licence

MIT

made with ♥

Keywords

react-native

FAQs

Package last updated on 27 Jan 2026

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