JWT Inspect

JWT Inspect is a copy-paste React component that stops helps keep live tokens out of online decoders before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/jwt-inspect
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsHelps keep live tokens out of online decoders

Was this component page useful?

How do I install JWT Inspect?

pnpm dlx shadcn@latest add @bollard/jwt-inspect

The files land in your project. They're yours to edit.

How do I use JWT Inspect in React?

jwt-inspect-usage.tsx
import { JwtInspect } from "@/components/ui/jwt-inspect"

<JwtInspect value={value} onValueChange={setValue} algorithms={["RS256"]} audience="api.acme.dev" issuer="https://auth.acme.dev" now={NOW} timeZone="Asia/Kolkata" />

What input mistakes does JWT Inspect catch?

  • alg none, and algorithms outside your allow-list
  • HS/RS confusion (HMAC where an RSA key is expected)
  • Expired token or nbf in the future, shown in local time
  • Timestamps in milliseconds instead of seconds
  • Missing or wrong aud/iss, very long lifetime
  • Secrets or personal data readable in the payload

What props does JWT Inspect accept?

JwtInspect props
PropTypeDefault
value

Controlled token text.

string—
defaultValue

Initial text when uncontrolled.

string""
onValueChange

Called with the new text on every edit or clear.

(value: string) => void—
algorithms

Algorithms your verifier allows, e.g. ["RS256"]. Others are flagged, and HS* against asymmetric as key confusion.

string[]—
audience

The audience this token should carry.

string—
issuer

The issuer this token should come from.

string—
type

The typ the header must carry, e.g. "at+jwt" (RFC 8725 explicit typing). Off by default.

string—
timeZone

IANA time zone for readable times. Defaults to the user's own.

string—
locale

Locale for readable times. Defaults to the user's own.

string—
now

Fixed "now" (for tests and demos). Otherwise the clock, ticking quietly.

Date | number—
leeway

Clock skew allowed, in seconds. Default 60.

number60
maxLifetime

Lifetimes longer than this many seconds are flagged. Default one day.

number86_400
label

Visible label; shorthand for `messages.label`.

string—
messages

Every visible string. `{detail}`, `{claim}`, `{span}`, `{time}`, `{allowed}`, `{audience}`, `{issuer}`, `{type}` are filled in.

Partial<JwtInspectMessages>—

* required. Also accepts the native props of <textarea> (className, aria-*, data-*…), passed through to it.

How is JWT Inspect accessible?

  • Visible label; input has aria-invalid and is described by the local-only note and the report
  • Report uses role=status; icons are aria-hidden
  • Clear button has an aria-label and returns focus to the field

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: Verify the signature, algorithm, issuer, audience and expiry on the server with a JWT library and a pinned key.

  • Decodes only; the signature is never verified
  • Secret and PII detection is pattern-based
  • Doesn't make a token safe to use; your server must verify it

What validation rules apply to JWT Inspect?

Rules last verified:

Informational. Checked RFC 8725's guidance on alg none and algorithm substitution; individual thresholds (lifetime, leeway) are product defaults, not standards. Copied components don't update themselves, so re-check after rule changes (see updating a component).

What expensive mistakes does JWT Inspect stop?

Helps keep live tokens out of online decoders

Also known as

jwt · jwt decoder · jwt.io · bearer token · access token · id token · claims · exp

What dependencies does JWT Inspect require?

JWT Inspect facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameJWT Inspect
Registry identifier@bollard/jwt-inspect
Install commandnpx shadcn@latest add @bollard/jwt-inspect
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about JWT Inspect

What form validation mistake does JWT Inspect catch?

JWT Inspect prevents helps keep live tokens out of online decoders. Decodes a JWT on the page, without sending it anywhere, and flags alg none, key confusion, expiry and readable secrets. Catches: alg none, and algorithms outside your allow-list, HS/RS confusion (HMAC where an RSA key is expected), Expired token or nbf in the future, shown in local time, Timestamps in milliseconds instead of seconds, Missing or wrong aud/iss, very long lifetime, Secrets or personal data readable in the payload. Limitation: validate jwt-inspect schemas on backend.

How do I install jwt-inspect with shadcn?

Run `npx shadcn@latest add @bollard/jwt-inspect`. Sources added: registry/default/jwt-inspect/jwt-inspect.tsx, registry/default/jwt-inspect/jwt.ts. Package requirements: lucide-react.

What props customize JWT Inspect?

JWT Inspect accepts `value`, `defaultValue`, `onValueChange`, `algorithms`, `audience`. Configures jwt, jwt decoder, jwt.io behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of jwt-inspect?

Decodes only; the signature is never verified. Secret and PII detection is pattern-based. Doesn't make a token safe to use; your server must verify it Server requirement: Verify the signature, algorithm, issuer, audience and expiry on the server with a JWT library and a pinned key.

How does JWT Inspect meet accessibility guidelines?

Visible label; input has aria-invalid and is described by the local-only note and the report. Report uses role=status; icons are aria-hidden. Clear button has an aria-label and returns focus to the field. Minimizes errors: jwt decode online unsafe, jwt expired token.

Which components pair with JWT Inspect?