Installation
unjwt is published to npm as unjwt.
Install
npm install unjwt
pnpm add unjwt
yarn add unjwt
bun add unjwt
deno add 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 from | What it gives you |
|---|---|
unjwt | Everything — a flat barrel suitable for bundlers. |
unjwt/jws | sign, verify, signMulti, verifyMulti, verifyMultiAll. |
unjwt/jwe | encrypt, decrypt, encryptMulti, decryptMulti. |
unjwt/jwk | Key generation, import/export, wrapping, PEM conversion, PBES2 derivation, cache control. |
unjwt/utils | Base64URL, type guards, claim validation, random bytes. |
unjwt/adapters/h3v1 | H3 v1 session adapter (Nuxt v4, Nitro v2). |
unjwt/adapters/h3v2 | H3 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.