1. License
“Permission is hereby granted, free of charge, to any person obtaining a copy”
MIT allows use in paid and closed-source apps.
github.com/panva/jose/blob/main/LICENSE.md3. Used by agents' projects
Dependency in 108 public GitHub projects set up for AI coding agents that we scanned (1.7%).
4. Agent access
Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.
From the package registry and GitHub, checked daily; card checked Nov 11, 2026. Tap a verdict to see its source.How we checkedReport an error
What jose does
jose is a free JavaScript library for login tokens, the signed strings called JWTs that prove who a user is. Your app uses it to issue a token after sign-in and to check every token that comes back, so forged or expired ones are refused. It runs in Node.js, browsers, Cloudflare Workers, Deno and Bun, and has no other packages inside.
What people build with it
Keep users signed in
After a user logs in, your server hands out a signed token that expires in two hours; later requests show it instead of the password.
Refuse forged or expired tokens
Every request to your server is checked; a token someone edited, one that has run out, or one meant for another app is turned away.
Accept Google or other sign-in tokens
Users sign in with Google or another login service; your server checks their token against the service's public keys, which jose downloads and caches.
Check tokens at the edge
A Cloudflare Worker or Deno function in front of your site checks the visitor's token before the page is served, with the same code as on the server.
Hide data inside a token
A token carries an email address or an order number that only your server can read, because the content is encrypted, not only signed.
Expiring links in emails Idea
A password reset or email confirmation link carries a signed token that works for 30 minutes and only for that one user.
jose popularity
Gid Score measures public popularity and activity, not quality. How the Gid Score is calculated
How jose is used
- jose is a dependency in 108 of the 6,258 public GitHub projects set up for AI coding agents that we scanned (2.2% of the 4,867 JavaScript/TypeScript ones), #6 of 141 in auth and security libraries.
- Counting the projects our scan samples by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750), it appears in 352; those are left out of every share on this page.
- The most used alternative in our scan is jsonwebtoken (149 projects).
- Projects that use it most often also use Next.js (64.8%), Zod (75.0%), Lucide React (65.7%).
By coding agent
Often used with
jose in practice
Strengths
The README's Supported Runtimes section lists Bun, browsers, Cloudflare Workers, Deno, Electron and Node.js, and marks the list as not exhaustive.
The README states that jose has no dependencies. It also says the exports are tree-shakeable ESM.
<code>EncryptJWT</code> encrypts tokens. <code>jwtDecrypt</code> decrypts them and validates the JWT Claims Set in the same step.
The module goes beyond tokens. It signs and verifies arbitrary JWS payloads, and encrypts and decrypts arbitrary JWE plaintext, in compact, flattened JSON and general JSON form. Each form has its own classes, such as <code>CompactSign</code> and <code>GeneralEncrypt</code>.
Watch out for
Some algorithms may be missing on a given runtime. The README links a separate issue for each runtime that lists its available algorithms.
The package is ESM. CommonJS <code>require('jose')</code> works only in Node.js versions where <code>require(esm)</code> is enabled by default.
The README's "Universal" label on v6.x comes with a footnote. It assumes the runtime supports the WebCryptoAPI and the Fetch API.
ESM import
import * as jose from 'jose'More about jose
Funding
- GitHub Sponsors: https://github.com/panva
- 22 GitHub sponsors
Head to head
- jsonwebtoken vs jose used together in 7 projects
Packages around it
- zod: Schema validation
- tailwind-merge: Tailwind class merging
- class-variance-authority: Component class variants
- clsx: className joining
- lucide-react: Icon components
- next: React framework
More in Auth and security libraries
Alternatives
jose This page
Pick jsonwebtoken when you maintain an older Node.js-only server that already uses it; jose also runs in browsers and edge workers.
Pick PyJWT when your backend is Python rather than JavaScript.
Pick Better Auth when you want a whole login system (accounts, sessions, sign-in methods) instead of writing it around tokens yourself.
Modular authentication middleware for Node.js supporting OAuth, JWT and local strategies.
Get started
Tell your AI assistant
“Use the npm package jose (pin jose@6.2.17, ES module import, Node.js 20+) to issue a 2-hour signed session token after login and to check it on every request with jwtVerify, passing issuer, audience and algorithms, and answering 401 on any jose error.”
Import it as an ES module.
import * as jose from 'jose'Sign a token with SignJWT, then check it with jwtVerify and the same secret (or the public key).
const secret = new TextEncoder().encode( 'cc7e0d44fd473002f1c42167459001140ec6389b7353f8088f4d9a95f2f596f2', ) const alg = 'HS256' const jwt = await new jose.SignJWT({ 'urn:example:claim': true }) .setProtectedHeader({ alg }) .setIssuedAt() .setIssuer('urn:example:issuer') .setAudience('urn:example:audience') .setExpirationTime('2h') .sign(secret)From github.com/panva/jose/blob/main/docs/jwt/sign/classes/SignJWT.md
Rules for your agent
## jose
- Import as ESM: `import * as jose from 'jose'`. Use `require('jose')` only on Node.js ^20.19.0 || ^22.12.0 || >= 23.0.0.
- Use `jwtVerify` for JWT signature verification and Claims Set validation. The README lists `decodeJwt` as a utility that decodes the JWT Claims Set "prior to its validation".
- To verify against an issuer's published keys, use `createRemoteJWKSet`. For a key set held locally, use `createLocalJWKSet`.
- Sign tokens with the `SignJWT` class. For encrypted tokens, encrypt with `EncryptJWT`, then decrypt and validate with `jwtDecrypt`.
- Import PEM keys with `importSPKI`, `importX509` or `importPKCS8`, and JWKs with `importJWK`. Generate keys with `generateKeyPair` or `generateSecret`.
- Before choosing an algorithm, check the README's per-runtime issue for the target runtime. Some algorithms are not available everywhere.
- The README's Supported Versions table lists only v6.x, so write code against v6.x.
Mistakes to avoid
decodeJwt checks nothing; in our run an edited token decoded as role=admin, while jwtVerify refused it with ERR_JWS_SIGNATURE_VERIFICATION_FAILED.
jose checks only what you ask for; a token from another app signed with the same key passes otherwise. Our run refused a wrong-audience token only because audience was set.
Version 6.0.0 changed key types and removed the Node.js-only agent option.
The runtime-specific packages are no longer maintained since v6.
Generated private keys cannot be exported unless you ask for it.
Questions
Can I read what is inside a token without the key?
Yes, decodeJwt reads it, but it checks nothing; anyone can edit a token that is only decoded. Use jwtVerify before you trust it.
Does it work with require() in older CommonJS code?
Only in Node.js versions where loading ES modules with require is on by default (20.19+, 22.12+ or 23+). Otherwise use import.
Does it check tokens from Google, Auth0 or other login services?
Yes. createRemoteJWKSet downloads the service's public keys from its URL, caches them, and jwtVerify uses them.
Can I use it in a paid app?
Yes. It is MIT-licensed and free; keep the license notice with the library files.