# jwt-parser

> jwt header parser

Latest version **2.0.0** (published 2017-09-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install jwt-parser
pnpm add jwt-parser
yarn add jwt-parser
bun add jwt-parser
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2017-09-11 |
| First published | 2016-09-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 4.8 |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | ferrari |
| Keywords | authorization, jwt |

## Links

- npm: https://www.npmjs.com/package/jwt-parser
- Repository: https://github.com/Ferrari/jwt-parser
- Homepage: https://github.com/Ferrari/jwt-parser#readme
- Issues: https://github.com/Ferrari/jwt-parser/issues
- npm.io page: https://npm.io/package/jwt-parser

## Dependencies (1)

- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^8.0.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

- 2.0.0 (latest) — 2017-09-11
- 1.0.0 — 2016-09-27

## README

# jwt-parser

[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Node.js Version][node-version-image]][node-version-url]
[![Build Status][travis-image]][travis-url]

Generic JWT Authorization header field parser for whatever.

## Installation

```
$ npm install jwt-parser
```

## API

```js
var auth = require('jwt-parser')
```

### auth(req, secret)

Get the JWT payload from the given request. JWT `secret` also required so 
it can decode and get payload correctly. The `Authorization`
header is parsed and if the header is invalid, `undefined` is returned,
otherwise will return decode jwt payload.

## Example

```js
var auth = require('jwt-parser');
var user = auth(req, secret);
```
# License

[MIT](LICENSE)

[npm-image]: https://img.shields.io/npm/v/jwt-parser.svg
[npm-url]: https://npmjs.org/package/jwt-parser
[node-version-image]: https://img.shields.io/node/v/jwt-parser.svg
[node-version-url]: https://nodejs.org/en/download
[travis-image]: https://img.shields.io/travis/Ferrari/jwt-parser/master.svg
[travis-url]: https://travis-ci.org/Ferrari/jwt-parser
[downloads-image]: https://img.shields.io/npm/dm/jwt-parser.svg
[downloads-url]: https://npmjs.org/package/jwt-parser

---
_Source: https://npm.io/package/jwt-parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
