npm latest version npm weekly downloads Maintainability code style: prettier License: CC BY-NC 4.0
Installation ●くろまる Usage ●くろまる Contributing ●くろまる Versioning ●くろまる Authors ●くろまる License
$ npm install @and-end/linkedin-auth-client
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
Please read CONTRIBUTING.md for details on the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Kacper Ochmański - Initial work, development - ochmanski
See also the list of contributors who participated in this project.
This project is licensed under the CC BY-NC 4.0 License - see the LICENSE file for details