# token-verify

> Token client for verifying and decoding JWTs.

Latest version **0.1.8** (published 2025-08-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install token-verify
pnpm add token-verify
yarn add token-verify
bun add token-verify
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.8 |
| Published | 2025-08-05 |
| First published | 2022-11-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=14 |
| Dependencies | 2 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | NorthOne |
| Maintainers | electblake |
| Keywords | token, jwt, jsonwebtoken, jwks-rsa, token-decode, authentication, oauth |

## Links

- npm: https://www.npmjs.com/package/token-verify
- Repository: https://github.com/northone-inc/token-verify
- Issues: https://github.com/northone-inc/token-verify/issues
- npm.io page: https://npm.io/package/token-verify

## Dependencies (2)

- [jwks-rsa](https://npm.io/package/jwks-rsa.md) ^3.0.0
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^9.0.2

## Alternatives

- [@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
- [escher-request](https://npm.io/package/escher-request.md) — 545 weekly downloads

## Recent versions

- 0.1.8 (latest) — 2025-08-05
- 0.1.7 — 2024-07-24
- 0.1.6 — 2022-12-01
- 0.1.5 — 2022-12-01
- 0.1.4 — 2022-12-01
- 0.1.3 — 2022-12-01
- 0.1.2 — 2022-12-01
- 0.1.0 — 2022-11-30

## README

> **Warning**
> This project is still experimental, not for production use - FEATURES MAY CHANGE WITHOUT WARNING

# Token Verifier
[![CI](https://github.com/northone-inc/token-verify/actions/workflows/ci.yml/badge.svg?event=push)](https://github.com/northone-inc/token-verify/actions/workflows/ci.yml)

This project exports a JWT client with capabilities to verify and decode tokens encrypted by RSA. The package uses [jsonwebtokens](https://www.npmjs.com/package/jsonwebtoken) and [jwks-rsa](https://www.npmjs.com/package/jwks-rsa).

## Usage Requirements
- Node 14 || 16 || 18

## Creating a JWT Client

To create a new client, provide the expected audience, public key issuer (jwksUri), and token issuers to the `jwtClient`.

```typescript
const client = new JwtClient({
  audience: 'apiAudience',
  jwksUri: 'pub-key.auth-issuer.com/.well-known/jwks.json',
  issuer: ['primary-issuer.com', 'secondary-issuer.com'],
  // jwt: {... advanced options escape-hatch} 
  // jwks: {...advanced options escape-hatch}
})
```

### Verifying and Decoding Tokens

The `verifyAndDecode` method can by used by passing in the jwt as a single argument.

```typescript
const payload = client.verifyAndDecode(token)

//Check for custom claims using hasClaim method
const hasEmailVerifiedClaim = hasClaim(payload, 'emailVerified')
```

## [Contributors](CONTRIBUTORS.md)

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