# @gcou/react-native-linkedin

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

Latest version **2.5.2** (published 2026-09-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @gcou/react-native-linkedin
pnpm add @gcou/react-native-linkedin
yarn add @gcou/react-native-linkedin
bun add @gcou/react-native-linkedin
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 2.5.2 |
| Published | 2026-09-08 |
| First published | 2022-08-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 22.13.0 |
| Dependencies | 2 |
| Unpacked size | 28.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Xavier Carpentier |
| Maintainers | gcou |
| Keywords | react-native, react-native-linkedin, linkedin |

## Links

- npm: https://www.npmjs.com/package/@gcou/react-native-linkedin
- Repository: https://github.com/GaelCO/react-native-linkedin
- Issues: https://github.com/GaelCO/react-native-linkedin/issues
- npm.io page: https://npm.io/package/@gcou/react-native-linkedin

## Dependencies (2)

- [uuid](https://npm.io/package/uuid.md) ^14.0.2
- [query-string](https://npm.io/package/query-string.md) 9.5.1

## Recent versions

- 2.5.2 (latest) — 2026-09-08
- 2.5.1 — 2026-06-12
- 2.5.0 — 2026-01-27
- 2.3.4 — 2025-09-26
- 2.3.3 — 2025-08-20
- 2.3.1 — 2024-08-22
- 2.3.0 — 2024-01-24
- 2.3.0-alpha.2 — 2024-01-24
- 2.3.0-alpha.1 — 2024-01-18
- 2.2.0 — 2023-06-29
- 2.1.9 — 2023-06-28
- 2.1.7 — 2022-09-26
- 2.1.6 — 2022-08-05

## README

<p align="center">
    <img alt="react-native-linkedin" src="https://thumbs.gfycat.com/IlliterateSecondDassie-size_restricted.gif" width=250>
</p>

<h3 align="center">
  🔗 React-Native LinkedIn
</h3>
<p align="center">
Simple <strong>LinkedIn</strong> login library for <strong>React-Native</strong> with <i>WebView</i> into a <i>Modal</i>
</p>
<p align="center">
  <a href="https://www.npmjs.com/package/@gcou/react-native-linkedin"><img src="https://img.shields.io/npm/v/@gcou/react-native-linkedin.svg"></a>
  <a href="https://www.npmjs.com/package/@gcou/react-native-linkedin"><img src="https://img.shields.io/npm/dm/@gcou/react-native-linkedin.svg?style=flat-square"></a>
</p>

<br />

## 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

```bash
$ yarn add @gcou/react-native-linkedin
```

### Peer Dependencies

| Package                          | Minimum version |
| --------------------------------- | ---------------- |
| react                             | >=19.1.0          |
| react-native                      | >=0.81.1          |
| react-native-get-random-values    | >=2.0.0           |
| react-native-webview              | *                 |

## 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**

- [> LinkedIn Documentation](https://docs.microsoft.com/en-us/linkedin/shared/api-guide/best-practices/secure-applications?context=linkedin/context#api-key-and-secret-key)

```tsx
  <LinkedInModal
    shouldGetAccessToken={false}
    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

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

import LinkedInModal, { LinkedInModalRef } from '@gcou/react-native-linkedin';

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

export default function AppContainer() : ReactElement {
  const linkedRef = useRef<LinkedInModalRef>(null);
  
  return (
    <View style={styles.container}>
      <LinkedInModal
        ref={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={() => linkedRef.current?.logoutAsync()} />
    </View>
  )
}
```

## Props

| Name                     | Type                          | Required                                                                              | Default                             | Description                                                                                                                                                                                              |
| ------------------------ |-------------------------------| ------------------------------------------------------------------------------------- | ----------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| clientID                 | string                        | **required**                                                                          |                                     | [Your client id](https://www.linkedin.com/developer/apps)                                                                                                                                                |
| <s>clientSecret</s>      | string                        | use **shouldGetAccessToken={false}** and read **authorization_code** onSuccess return |                                     | Should not be stored in app [WARNING! Your client secret](https://docs.microsoft.com/en-us/linkedin/shared/api-guide/best-practices/secure-applications?context=linkedin/context#api-key-and-secret-key) |
| redirectUri              | string                        | **required**                                                                          |                                     | [Your redirectUri](https://www.linkedin.com/developer/apps)                                                                                                                                              |
| onSuccess                | function                      | **required**                                                                          |                                     | Function will be call back on success                                                                                                                                                                    |
| authState                | string                        | optional                                                                              | `require('uuid').v4()`              | The state of auth, to be more secure                                                                                                                                                                     |
| onError                  | function                      | optional                                                                              | `console.error(err)`                | Function will be call back on error                                                                                                                                                                      |
| onClose                  | function                      | optional                                                                              |                                     | Function will be call back on close modal                                                                                                                                                                |
| onOpen                   | function                      | optional                                                                              |                                     | Function will be call back on open modal                                                                                                                                                                 |
| onSignIn                 | function                      | optional                                                                              |                                     | Function will be call back when the user sign in                                                                                                                                                         |
| permissions              | string[]                      | optional                                                                              | `'r_liteprofile', 'r_emailaddress'` | The LinkedIn access token permissions                                                                                                                                                                    |
| renderButton             | ReactElement                  | optional                                                                              |                                     | Render for customize LinkedIn button                                                                                                                                                            |
| renderClose              | ReactElement                  | optional                                                                              |                                     | Render for customize close button                                                                                                                                                               |
| linkText                 | string                        | optional                                                                              | `'Login with LinkedIn'`             | Link label                                                                                                                                                                                               |
| containerStyle           | StyleProp<ViewStyle>          | optional                                                                              |                                     | Customize container style                                                                                                                                                                                |
| wrapperStyle             | StyleProp<ViewStyle>          | optional                                                                              |                                     | Customize wrapper style                                                                                                                                                                                  |
| closeStyle               | StyleProp<ViewStyle>          | optional                                                                              |                                     | Customize close style                                                                                                                                                                                    |
| animationType            | Modal.propTypes.animationType | optional                                                                              | `fade`                              | Customize animationType style: 'none', 'slide' or 'fade'                                                                                                                                                 |
| **shouldGetAccessToken** | bool                          | optional                                                                              | `true`                              | Set to false to receive the 'authorization code' rather then the 'access token'                                                                                                                          |
| areaTouchText | object                        | optional       | `{top: 20, bottom: 20, left: 50, right: 50}`          | Set values for to increase the text touch area          |
| isDisabled               | bool                           | optional                                                                              | `false`                              | Disable the LinkedIn login button                                                                                                                                                                        |

## Contribution

- [@xcarpentier](mailto:contact@xaviercarpentier.com) The main author.

**PRs are welcome!**

## FAQ

### Is it supported and tested both on android and iOS?

**YES**

### How to logout react-native-linkedin?
```tsx
<View style={styles.container}>
    <LinkedInModal
      ref={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={() => linkedRef.current?.logoutAsync()} />
</View>
```

## Alternatives

- [react-native-linkedin-login](https://www.npmjs.com/package/react-native-linkedin-login)
- [react-native-linkedin-sdk](https://www.npmjs.com/package/react-native-linkedin-sdk)
- [react-native-linkedin-oauth](https://www.npmjs.com/package/react-native-linkedin-oauth)

## Licence

[MIT](https://github.com/GaelCO/react-native-linkedin/blob/master/LICENSE)

> made with ♥

---
_Source: https://npm.io/package/@gcou/react-native-linkedin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
