1.0.0-rc.3 • Published 4 years ago

@node-plex/api-auth v1.0.0-rc.3

Weekly downloads
3
License
MIT
Repository
gitlab
Last release
4 years ago

@node-plex/api-auth

Authorizes external applications to use the Plex API.

CI pipeline status project vulnerabilities project dependencies code coverage code style standardjs versioning strategy required Node version

Releases

latest release version next release version package install size

Getting Started

Installation

$ npm install @node-plex/api-auth

Usage

const PlexAppAuthenticator = require('@node-plex/api-auth')

const paa = new PlexAppAuthenticator({
  headers: {
    'X-Plex-Client-Identifier': '<your application uuidv4>',
    'X-Plex-Product': '<your application name>',
    'X-Plex-Version': '<your application version>',
  },
  password: '<your Plex password>',
  username: '<your Plex username>',
})

paa.authorize()
  .then(console.log) // resolves to auth token as String
  .catch(console.error)

:information_source: headers key may contain:

// an object with header name:value pairs
{ 'X-Header': 'value' }
// a Header instance
const headers = new Headers()
headers.set('X-Header', 'value')

:informationsource: headers _must include:

"X-Plex-Client-Identifier",
"X-Plex-Product",
"X-Plex-Version"

Built with

Fedora Linux VSCode GitLab Caffeine

Contributing

Please read CONTRIBUTING.md for details on how to contribute to this project.

License

NPM

Copyright 2020 © Chet Manley.

Acknowledgements

Based on phillipj's node-plex-api-credentials, this rewrite aims to improve upon it in two major ways:

  • Implement the most current official token retrieval method provided by Plex.
  • Use ES2015+ code conventions and best practices.
1.0.0-rc.4

4 years ago

1.0.0-rc.3

4 years ago

1.0.0-rc.2

4 years ago

1.0.0-rc.1

4 years ago