# @and-end/linkedin-auth-client

> A simple client for authentication using LinkedIn

Latest version **1.1.2** (published 2019-11-01) · CC BY-NC 4.0 license · 0 weekly downloads

## Install

```sh
npm install @and-end/linkedin-auth-client
pnpm add @and-end/linkedin-auth-client
yarn add @and-end/linkedin-auth-client
bun add @and-end/linkedin-auth-client
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2019-11-01 |
| First published | 2019-10-30 |
| Weekly downloads | 0 |
| License | CC BY-NC 4.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 47.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Kacper Ochmański |
| Maintainers | ochmanski |
| Keywords | linkedin, linkedin-api, authentication, authorization, oauth2, auth, auth-client, auth-wrapper, api-client, api-wrapper |

## Links

- npm: https://www.npmjs.com/package/@and-end/linkedin-auth-client
- Repository: https://github.com/and-end/linkedin-auth-client
- Homepage: https://github.com/and-end/linkedin-auth-client#readme
- Issues: https://github.com/and-end/linkedin-auth-client/issues
- npm.io page: https://npm.io/package/@and-end/linkedin-auth-client

## Dependencies (1)

- [qs](https://npm.io/package/qs.md) ^6.9.0

## Alternatives

- [@clerk/clerk-expo](https://npm.io/package/@clerk/clerk-expo.md) — 133.6K weekly downloads
- [@pothos/plugin-authz](https://npm.io/package/@pothos/plugin-authz.md) — 12.4K weekly downloads
- [@bounded-sh/client](https://npm.io/package/@bounded-sh/client.md) — 3.2K weekly downloads
- [@luigi-project/plugin-auth-oauth2](https://npm.io/package/@luigi-project/plugin-auth-oauth2.md) — 2.3K weekly downloads
- [@nocobase/plugin-verification](https://npm.io/package/@nocobase/plugin-verification.md) — 2.0K weekly downloads

## Recent versions

- 1.1.2 (latest) — 2019-11-01
- 1.1.1 — 2019-11-01
- 1.1.0 — 2019-11-01
- 1.0.0 — 2019-10-30

## README

<h1 align='center'>
  <br>
  <a align='center' href='https://docs.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow?context=linkedin/consumer/context'>
    <img src='https://content.linkedin.com/content/dam/me/business/en-us/amp/brand-site/v2/bg/LI-Bug.svg.original.svg' alt='LinkedIn Logo' width='75' align='center' />
  </a>
  <p align='center'>LinkedIn auth client</p>
</h1>

<h4 align='center'>A simple client for authentication using LinkedIn.</h4>

<p align='center'>
    <a href='https://www.npmjs.com/package/@and-end/linkedin-auth-client/v/latest'>
        <img alt='npm latest version' src='https://img.shields.io/npm/v/@and-end/linkedin-auth-client/latest' />
    </a>
    <a href='https://www.npmjs.com/package/@and-end/linkedin-auth-client/v/latest'>
        <img alt='npm weekly downloads' src='https://img.shields.io/npm/dw/@and-end/linkedin-auth-client' />
    </a>
    <a href='https://codeclimate.com/github/and-end/linkedin-auth-client/maintainability'>
        <img alt='Maintainability' src='https://api.codeclimate.com/v1/badges/9480af563b20557dc776/maintainability' />
    </a>
    <a href='https://github.com/prettier/prettier'>
        <img alt='code style: prettier' src='https://img.shields.io/badge/code_style-prettier-ff69b4.svg' />
    </a>
    <a href='https://creativecommons.org/licenses/by-nc/4.0/'>
        <img alt='License: CC BY-NC 4.0' src='https://img.shields.io/npm/l/@and-end/linkedin-auth-client' />
    </a>
</p>

<p align='center'>
  <a href='#installation'>Installation</a>&nbsp;&nbsp;●&nbsp;
  <a href='#usage'>Usage</a>&nbsp;&nbsp;●&nbsp;
  <a href='#contributing'>Contributing</a>&nbsp;&nbsp;●&nbsp;
  <a href='#versioning'>Versioning</a>&nbsp;&nbsp;●&nbsp;
  <a href='#authors'>Authors</a>&nbsp;&nbsp;●&nbsp;
  <a href='#license'>License</a>
</p>

## Installation

```bash
$ npm install @and-end/linkedin-auth-client
```

## Usage

```typescript
import fetch from 'node-fetch';
import LinkedInAuthClient from '@and-end/linkedin-auth-client';

const config = { fetchProvider: fetch };
const params = {
  client_id: 'xxxxxxxxxxxxxx',
  client_secret: 'xxxxxxxxxxxxxxxx',
  redirect_uri: 'https://example.com/auth/linkedin',
  scope: ['r_liteprofile', 'r_emailaddress'],
  response_type: 'code',
  grant_type: 'authorization_code'
};

const linkedInAuthClient = new LinkedInAuthClient(config);

linkedInAuthClient.init(params);

const authorizationCode = 'xxxxxxxxxxxxxxxxxxxx';
const data = await linkedInAuthClient.getAccessToken(authorizationCode);

console.log(data); // => { access_token: 'xxxxxxx', expires_in: '5184000' }
```

See how to request an authorization code in [`test/devServer.ts`](test/devServer.ts)

Api reference: https://docs.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow?context=linkedin/consumer/context#step-2-request-an-authorization-code

## Contributing

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on the process for submitting pull requests to us.

## Versioning

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/and-end/linkedin-auth-client/tags).

## Authors

- **Kacper Ochmański** - _Initial work, development_ - [ochmanski](https://github.com/ochmanski)

See also the list of [contributors](https://github.com/and-end/linkedin-auth-client/contributors) who participated in this project.

## License

This project is licensed under the [CC BY-NC 4.0 License](https://creativecommons.org/licenses/by-nc/4.0/deed.en) - see the [LICENSE](LICENSE) file for details

---
_Source: https://npm.io/package/@and-end/linkedin-auth-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
