Skip to content
Agents tracked: 506 Releases (7d): 634 Agent status: 4 with issuesSince last limit reset: Claude 15d · Codex 0d For AI agents: Markdown Updated Nov 26, 2026

jose

Sign and check login tokens (JWT) in JavaScript.

Auth and security librariesNPM

GitHubWebsite

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.md

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

75 / 100
Gid Score, #199 overall
244M
downloads a week, npm
7,894
GitHub stars
108
agent projects use it
jose: downloads per weeknpm, jose 244,235,645
jose: GitHub starspanva/jose 7,894

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

67 projects, 2.0%
53 projects, 1.7%
41 projects, 1.7%
12 projects, 2.5%
8 projects, 1.7%
6 projects, 1.7%

Often used with

In 64.8% of its projects
In 75.0% of its projects
In 65.7% of its projects
In 63.0% of its projects
In 63.9% of its projects
In 80.6% of its projects
In 49.1% of its projects
In 75.9% of its projects

jose in practice

Strengths

One module from server to edge to browser

The README's Supported Runtimes section lists Bun, browsers, Cloudflare Workers, Deno, Electron and Node.js, and marks the list as not exhaustive.

Zero dependencies, tree-shakeable ESM

The README states that jose has no dependencies. It also says the exports are tree-shakeable ESM.

Encrypted JWTs alongside signed ones

<code>EncryptJWT</code> encrypts tokens. <code>jwtDecrypt</code> decrypts them and validates the JWT Claims Set in the same step.

Raw JWS and JWE in all three serializations

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

Algorithm support depends on the runtime

Some algorithms may be missing on a given runtime. The README links a separate issue for each runtime that lists its available algorithms.

require() only on recent Node.js

The package is ESM. CommonJS <code>require('jose')</code> works only in Node.js versions where <code>require(esm)</code> is enabled by default.

Assumes WebCrypto and Fetch

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

See all

Head to head
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

MITGid 75244M/wk

jsonwebtoken

Pick jsonwebtoken when you maintain an older Node.js-only server that already uses it; jose also runs in browsers and edge workers.

MITGid 7984.5M/wk

PyJWT

Pick PyJWT when your backend is Python rather than JavaScript.

Better Auth

Pick Better Auth when you want a whole login system (accounts, sessions, sign-in methods) instead of writing it around tokens yourself.

Passport.js

Modular authentication middleware for Node.js supporting OAuth, JWT and local strategies.

MITGid 6910.5M/wk

Compare jose with another tool

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.”

  1. Add jose to your project.

    npm install jose

    From github.com/panva/jose/blob/main/README.md

  2. Import it as an ES module.

    import * as jose from 'jose'

    From github.com/panva/jose/blob/main/README.md

  3. 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

Paste into AGENTS.md or CLAUDE.md
## 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

const user = jose.decodeJwt(req.cookies.token) // then trust user.role
const { payload } = await jose.jwtVerify(token, key, { issuer, audience, algorithms })

decodeJwt checks nothing; in our run an edited token decoded as role=admin, while jwtVerify refused it with ERR_JWS_SIGNATURE_VERIFICATION_FAILED.

await jose.jwtVerify(token, key) // no issuer, audience or algorithms
Pass issuer, audience and algorithms (and requiredClaims if you need them) in the jwtVerify options

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.

Code written for jose v4/v5 that expects KeyObject from generateKeyPair or importSPKI, or passes agent to createRemoteJWKSet
In v6 these return CryptoKey; createRemoteJWKSet uses fetch, so drop the agent option and use its fetch-related options

Version 6.0.0 changed key types and removed the Node.js-only agent option.

Installing jose-node-cjs-runtime, jose-node-esm-runtime or jose-browser-runtime
npm install jose (one package for every runtime)

The runtime-specific packages are no longer maintained since v6.

const { privateKey } = await jose.generateKeyPair('ES256'); await jose.exportPKCS8(privateKey)
Pass { extractable: true } to generateKeyPair when you need to save the private key

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.