# @byu-oit/jwt

> Utilities for verifying and decoding BYU JWTs

Latest version **0.2.4** (published 2026-04-07) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @byu-oit/jwt
pnpm add @byu-oit/jwt
yarn add @byu-oit/jwt
bun add @byu-oit/jwt
```

## Health

**Score 60/100 (C)** — status: active.

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

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.2.4 |
| Published | 2026-04-07 |
| First published | 2023-04-28 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 61 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Spencer Tuft |
| Maintainers | yoshutch, lehinpm, oscea, stuft2, mhailstone, arasmus8, garygsc, snelg, gholl0, byu-oit-bot, mjweather |

## Links

- npm: https://www.npmjs.com/package/@byu-oit/jwt
- Repository: https://github.com/byu-oit/byu-jwt-nodejs
- Homepage: https://github.com/byu-oit/byu-jwt-nodejs#readme
- Issues: https://github.com/byu-oit/byu-jwt-nodejs/issues
- npm.io page: https://npm.io/package/@byu-oit/jwt

## Dependencies (3)

- [node-cache](https://npm.io/package/node-cache.md) ^5.1.2
- [@byu-oit-sdk/jwt](https://npm.io/package/@byu-oit-sdk/jwt.md) ^0.3.1
- [@sinclair/typebox](https://npm.io/package/@sinclair/typebox.md) ^0.31.2

## Recent versions

- 0.2.4 (latest) — 2026-04-07
- 0.2.3 — 2026-04-06
- 0.1.1 — 2025-07-28
- 0.0.8 — 2025-06-23
- 0.0.7 — 2023-09-25
- 0.0.7-beta.2 — 2023-09-25
- 0.0.7-beta.1 — 2023-09-14
- 0.0.7-beta.0 — 2023-09-11
- 0.0.6 — 2023-07-10
- 0.0.5 — 2023-07-07
- 0.0.4 — 2023-06-30
- 0.0.3 — 2023-06-06
- 0.0.2 — 2023-05-08
- 0.0.1 — 2023-05-08
- 0.0.1-beta.3 — 2023-05-05
- … 3 more at https://npm.io/package/@byu-oit/jwt/versions

## README

# `@byu-oit/jwt`

> Provides helpful functions to retrieve a specified BYU .well-known URL and verify BYU signed JWTs.

## Usage

```javascript
import { ByuJwt } from '@byu-oit/jwt'

const byuJwt = ByuJwt.create({ issuer: 'https://api.byu.edu' })

const jwt = byuJwt.verify('[your jwt]')

/** Access the jwt payload information */
const { byuId } = jwt.payload

/** Access the jwt header information */
const { alg } = jwt.header
```

> **Note**
> Please refer
> to [the API documentation](https://byu-oit.github.io/byu-jwt-nodejs) if you need
> to see what information is made available in
> the [jwt payload](https://byu-oit.github.io/byu-jwt-nodejs/classes/BYU_JWT.JwtPayload.html)
> or [header](https://byu-oit.github.io/byu-jwt-nodejs/classes/BYU_JWT.JwtHeader.html).

## Options

| property              | type    | default            | description                                                                                                                                                                                                                        |
|-----------------------|---------|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| issuer                | string  | `undefined`        | The OAuth Provider host, e.g. `https://api.byu.edu`. Either the issuer or the discoveryEndpoint are required but not both. If the discoveryEndpoint is not provided, the issuer will be used to specify the open id configuration. |
| discoveryEndpoint     | string  | `undefined`        | Can specify the discoveryEndpoint explicitly if your open id configuration is not located at `/.well-known/openid-configuration`. Either the issuer or the discoveryEndpoint are required but not both.                            |
| key                   | string  | `undefined`        | A JWK in the form of a PEM Certificate that will be used to verify the JWT.                                                                                                                                                        |
| additionalValidations | array   | `undefined`        | An array of additional validation functions that can be run when `verify()` is called. Each function should accept a decoded jwt as its parameter, throw an error if the validation fails, and return void if it succeeds.         |
> There are additional options that can be passed in that are all listed under the fast-jwt [VerifierOptions](https://nearform.github.io/fast-jwt/docs/api/interfaces/VerifierOptions) properties. Descriptions of these properties can be found [here](https://nearform.github.io/fast-jwt/#createverifier).

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