Installation

unjwt is published to npm as unjwt.

Install

npm install unjwt

Or use nypm to auto-detect the package manager:

npx nypm install unjwt

Requirements

  • Node.js 22+, or any runtime with the Web Crypto API globally available (Deno, Bun, Cloudflare Workers, browsers).
  • ESM only. unjwt is shipped as pure ECMAScript modules.

The core package has zero runtime dependencies. The H3 session adapters (unjwt/adapters/h3v1, unjwt/adapters/h3v2) use optional peer dependencies (h3, cookie-es) which you install alongside your framework.

Import paths

unjwt is split across several named entry points so bundlers can tree-shake aggressively:

Import fromWhat it gives you
unjwtEverything — a flat barrel suitable for bundlers.
unjwt/jwssign, verify, signMulti, verifyMulti, verifyMultiAll.
unjwt/jweencrypt, decrypt, encryptMulti, decryptMulti.
unjwt/jwkKey generation, import/export, wrapping, PEM conversion, PBES2 derivation, cache control.
unjwt/utilsBase64URL, type guards, claim validation, random bytes.
unjwt/adapters/h3v1H3 v1 session adapter (Nuxt v4, Nitro v2).
unjwt/adapters/h3v2H3 v2 session adapter (Nuxt v5, Nitro v3).

Both patterns work:

// Namespaced — smallest bundle if you only use one module
import { sign, verify } from "unjwt/jws";

// Flat — convenient for bundlers
import { sign, encrypt, generateJWK } from "unjwt";

AI-assistant skill

A pre-built Agent Skill is available for Claude Code (and compatible harnesses) covering unjwt's public API:

npx skills add sandros94/unjwt

Once installed, asking your agent about unjwt, JWS, JWE, or JWK will trigger the skill and load the reference files from /unjwt.

Next

Create your first signed token →