{
 "kind": "tool",
 "slug": "jose",
 "path": "tools/jose/",
 "name": "jose",
 "maker": null,
 "density": "full",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Auth and security libraries",
   "tools/auth-security/"
  ]
 ],
 "lead": "Sign and check login tokens (JWT) in JavaScript.",
 "chips": [
  {
   "label": "Auth and security libraries",
   "path": "tools/auth-security/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install jose"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/panva/jose"
  },
  {
   "label": "Website",
   "href": "https://github.com/panva/jose"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "MIT",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": "Permission is hereby granted, free of charge, to any person obtaining a copy",
   "note": "MIT allows use in paid and closed-source apps.",
   "src": "https://github.com/panva/jose/blob/main/LICENSE.md"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Nov 18, 2026",
   "note": "Latest GitHub release Nov 18, 2026. ",
   "src": "https://github.com/panva/jose"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "108 projects",
   "status": "info",
   "sub": "#6 of 141 in its category",
   "note": "Dependency in 108 public GitHub projects set up for AI coding agents that we scanned (1.7%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily; card checked Nov 11, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What jose does",
   "parts": [
    {
     "t": "prose",
     "text": "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."
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Keep users signed in",
       "text": "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.",
       "idea": false
      },
      {
       "title": "Refuse forged or expired tokens",
       "text": "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.",
       "idea": false
      },
      {
       "title": "Accept Google or other sign-in tokens",
       "text": "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.",
       "idea": false
      },
      {
       "title": "Check tokens at the edge",
       "text": "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.",
       "idea": false
      },
      {
       "title": "Hide data inside a token",
       "text": "A token carries an email address or an order number that only your server can read, because the content is encrypted, not only signed.",
       "idea": false
      },
      {
       "title": "Expiring links in emails",
       "text": "A password reset or email confirmation link carries a signed token that works for 30 minutes and only for that one user.",
       "idea": true
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "jose popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "75",
       "of": "/ 100",
       "l": "Gid Score, #199 overall"
      },
      {
       "n": "244M",
       "l": "downloads a week, npm"
      },
      {
       "n": "7,894",
       "l": "GitHub stars"
      },
      {
       "n": "108",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How jose is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "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%)."
     ]
    },
    {
     "t": "h3",
     "text": "By coding agent"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "67 projects, 2.0%",
       "v": "Claude Code",
       "path": "agents/claude-code/"
      },
      {
       "l": "53 projects, 1.7%",
       "v": "GitHub Copilot",
       "path": "agents/github-copilot/"
      },
      {
       "l": "41 projects, 1.7%",
       "v": "Cursor",
       "path": "agents/cursor/"
      },
      {
       "l": "12 projects, 2.5%",
       "v": "Gemini CLI",
       "path": "agents/gemini-cli/"
      },
      {
       "l": "8 projects, 1.7%",
       "v": "OpenAI Codex",
       "path": "agents/openai-codex/"
      },
      {
       "l": "6 projects, 1.7%",
       "v": "OpenCode",
       "path": "agents/opencode/"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 64.8% of its projects",
       "v": "Next.js",
       "path": "tools/next/"
      },
      {
       "l": "In 75.0% of its projects",
       "v": "Zod",
       "path": "tools/zod/"
      },
      {
       "l": "In 65.7% of its projects",
       "v": "Lucide React",
       "path": "tools/lucide-react/"
      },
      {
       "l": "In 63.0% of its projects",
       "v": "Tailwind Merge",
       "path": "tools/tailwind-merge/"
      },
      {
       "l": "In 63.9% of its projects",
       "v": "clsx",
       "path": "tools/clsx/"
      },
      {
       "l": "In 80.6% of its projects",
       "v": "React",
       "path": "tools/react/"
      },
      {
       "l": "In 49.1% of its projects",
       "v": "Radix UI",
       "path": "tools/radix-ui/"
      },
      {
       "l": "In 75.9% of its projects",
       "v": "Tailwind CSS",
       "path": "tools/tailwindcss/"
      }
     ]
    }
   ]
  },
  {
   "id": "profile",
   "nav": "Profile",
   "h2": "jose in practice",
   "parts": [
    {
     "t": "h3",
     "text": "Strengths"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "One module from server to edge to browser",
       "v": "The README's Supported Runtimes section lists Bun, browsers, Cloudflare Workers, Deno, Electron and Node.js, and marks the list as not exhaustive."
      },
      {
       "l": "Zero dependencies, tree-shakeable ESM",
       "v": "The README states that jose has no dependencies. It also says the exports are tree-shakeable ESM."
      },
      {
       "l": "Encrypted JWTs alongside signed ones",
       "v": "<code>EncryptJWT</code> encrypts tokens. <code>jwtDecrypt</code> decrypts them and validates the JWT Claims Set in the same step."
      },
      {
       "l": "Raw JWS and JWE in all three serializations",
       "v": "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>."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Watch out for"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Algorithm support depends on the runtime",
       "v": "Some algorithms may be missing on a given runtime. The README links a separate issue for each runtime that lists its available algorithms."
      },
      {
       "l": "require() only on recent Node.js",
       "v": "The package is ESM. CommonJS <code>require('jose')</code> works only in Node.js versions where <code>require(esm)</code> is enabled by default."
      },
      {
       "l": "Assumes WebCrypto and Fetch",
       "v": "The README's \"Universal\" label on v6.x comes with a footnote. It assumes the runtime supports the WebCryptoAPI and the Fetch API."
      }
     ]
    },
    {
     "t": "h3",
     "text": "ESM import"
    },
    {
     "t": "tabs",
     "label": "Example",
     "items": [
      {
       "tab": "Js",
       "code": "import * as jose from 'jose'"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "profile",
   "h2": "More about jose",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Funding",
       "path": "tools/funding/",
       "items": [
        "GitHub Sponsors: https://github.com/panva",
        "22 GitHub sponsors"
       ]
      },
      {
       "title": "Head to head",
       "items": [
        {
         "text": "jsonwebtoken vs jose",
         "note": "used together in 7 projects",
         "path": "tools/compare/jsonwebtoken-vs-jose/"
        }
       ]
      },
      {
       "title": "Packages around it",
       "items": [
        "zod: Schema validation",
        "tailwind-merge: Tailwind class merging",
        "class-variance-authority: Component class variants",
        "clsx: className joining",
        "lucide-react: Icon components",
        "next: React framework"
       ]
      },
      {
       "title": "More in Auth and security libraries",
       "path": "tools/auth-security/",
       "items": [
        {
         "text": "bcryptjs",
         "path": "tools/bcryptjs/"
        },
        {
         "text": "NextAuth.js",
         "path": "tools/next-auth/"
        },
        {
         "text": "cryptography",
         "path": "tools/cryptography/"
        },
        {
         "text": "PyJWT",
         "path": "tools/pyjwt/"
        },
        {
         "text": "Better Auth",
         "path": "tools/better-auth/"
        },
        {
         "text": "DOMPurify",
         "path": "tools/dompurify/"
        },
        {
         "text": "Helmet",
         "path": "tools/helmet/"
        },
        {
         "text": "bcrypt (JavaScript)",
         "path": "tools/bcrypt-npm/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "jose",
       "me": true,
       "facts": [
        "MIT",
        "Gid 75",
        "244M/wk"
       ]
      },
      {
       "name": "jsonwebtoken",
       "why": "Pick jsonwebtoken when you maintain an older Node.js-only server that already uses it; jose also runs in browsers and edge workers.",
       "path": "tools/jsonwebtoken/",
       "facts": [
        "MIT",
        "Gid 79",
        "84.5M/wk"
       ]
      },
      {
       "name": "PyJWT",
       "why": "Pick PyJWT when your backend is Python rather than JavaScript.",
       "path": "tools/pyjwt/",
       "facts": []
      },
      {
       "name": "Better Auth",
       "why": "Pick Better Auth when you want a whole login system (accounts, sessions, sign-in methods) instead of writing it around tokens yourself.",
       "path": "tools/better-auth/",
       "facts": []
      },
      {
       "name": "Passport.js",
       "why": "Modular authentication middleware for Node.js supporting OAuth, JWT and local strategies.",
       "path": "tools/passport/",
       "facts": [
        "MIT",
        "Gid 69",
        "10.5M/wk"
       ]
      }
     ],
     "more": "Compare jose with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "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."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Add jose to your project.",
       "code": "npm install jose",
       "src": "https://github.com/panva/jose/blob/main/README.md"
      },
      {
       "text": "Import it as an ES module.",
       "code": "import * as jose from 'jose'",
       "src": "https://github.com/panva/jose/blob/main/README.md"
      },
      {
       "text": "Sign a token with SignJWT, then check it with jwtVerify and the same secret (or the public key).",
       "code": "const secret = new TextEncoder().encode(\n  'cc7e0d44fd473002f1c42167459001140ec6389b7353f8088f4d9a95f2f596f2',\n)\nconst alg = 'HS256'\n\nconst jwt = await new jose.SignJWT({ 'urn:example:claim': true })\n  .setProtectedHeader({ alg })\n  .setIssuedAt()\n  .setIssuer('urn:example:issuer')\n  .setAudience('urn:example:audience')\n  .setExpirationTime('2h')\n  .sign(secret)\n",
       "src": "https://github.com/panva/jose/blob/main/docs/jwt/sign/classes/SignJWT.md"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Rules for your agent"
    },
    {
     "t": "rules",
     "label": "Paste into AGENTS.md or CLAUDE.md",
     "text": "## jose\n- Import as ESM: `import * as jose from 'jose'`. Use `require('jose')` only on Node.js ^20.19.0 || ^22.12.0 || >= 23.0.0.\n- 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\".\n- To verify against an issuer's published keys, use `createRemoteJWKSet`. For a key set held locally, use `createLocalJWKSet`.\n- Sign tokens with the `SignJWT` class. For encrypted tokens, encrypt with `EncryptJWT`, then decrypt and validate with `jwtDecrypt`.\n- Import PEM keys with `importSPKI`, `importX509` or `importPKCS8`, and JWKs with `importJWK`. Generate keys with `generateKeyPair` or `generateSecret`.\n- Before choosing an algorithm, check the README's per-runtime issue for the target runtime. Some algorithms are not available everywhere.\n- The README's Supported Versions table lists only v6.x, so write code against v6.x.\n"
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "const user = jose.decodeJwt(req.cookies.token)   // then trust user.role",
       "fix": "const { payload } = await jose.jwtVerify(token, key, { issuer, audience, algorithms })",
       "why": "decodeJwt checks nothing; in our run an edited token decoded as role=admin, while jwtVerify refused it with ERR_JWS_SIGNATURE_VERIFICATION_FAILED."
      },
      {
       "dont": "await jose.jwtVerify(token, key)   // no issuer, audience or algorithms",
       "fix": "Pass issuer, audience and algorithms (and requiredClaims if you need them) in the jwtVerify options",
       "why": "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."
      },
      {
       "dont": "Code written for jose v4/v5 that expects KeyObject from generateKeyPair or importSPKI, or passes agent to createRemoteJWKSet",
       "fix": "In v6 these return CryptoKey; createRemoteJWKSet uses fetch, so drop the agent option and use its fetch-related options",
       "why": "Version 6.0.0 changed key types and removed the Node.js-only agent option."
      },
      {
       "dont": "Installing jose-node-cjs-runtime, jose-node-esm-runtime or jose-browser-runtime",
       "fix": "npm install jose (one package for every runtime)",
       "why": "The runtime-specific packages are no longer maintained since v6."
      },
      {
       "dont": "const { privateKey } = await jose.generateKeyPair('ES256'); await jose.exportPKCS8(privateKey)",
       "fix": "Pass { extractable: true } to generateKeyPair when you need to save the private key",
       "why": "Generated private keys cannot be exported unless you ask for it."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Can I read what is inside a token without the key?",
       "a": "Yes, decodeJwt reads it, but it checks nothing; anyone can edit a token that is only decoded. Use jwtVerify before you trust it.",
       "evidence": {
        "url": "https://github.com/panva/jose/blob/main/docs/util/decode_jwt/functions/decodeJwt.md",
        "quote": "Decodes the Claims Set of a JWT in JWS Compact Serialization without validating its JWS Signature (digital signature or MAC) or claim types and values."
       }
      },
      {
       "q": "Does it work with require() in older CommonJS code?",
       "a": "Only in Node.js versions where loading ES modules with require is on by default (20.19+, 22.12+ or 23+). Otherwise use import.",
       "evidence": {
        "url": "https://github.com/panva/jose/blob/main/README.md",
        "quote": "is possible in Node.js versions where the require(esm) feature is enabled by default (^20.19.0 || ^22.12.0 || >= 23.0.0)."
       }
      },
      {
       "q": "Does it check tokens from Google, Auth0 or other login services?",
       "a": "Yes. createRemoteJWKSet downloads the service's public keys from its URL, caches them, and jwtVerify uses them.",
       "evidence": {
        "url": "https://github.com/panva/jose/blob/main/docs/jwks/remote/functions/createRemoteJWKSet.md",
        "quote": "Fetches the JSON Web Key Set when the cache is missing or stale."
       }
      },
      {
       "q": "Can I use it in a paid app?",
       "a": "Yes. It is MIT-licensed and free; keep the license notice with the library files.",
       "evidence": {
        "url": "https://github.com/panva/jose/blob/main/LICENSE.md",
        "quote": "Permission is hereby granted, free of charge, to any person obtaining a copy"
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm jose"
  ],
  [
   "Category",
   "Auth and security libraries"
  ],
  [
   "License",
   "MIT"
  ],
  [
   "Latest version",
   "v6.2.12, September 5, 2026"
  ],
  [
   "On GitHub since",
   "November 2018"
  ],
  [
   "Gid Score",
   "75.3"
  ],
  [
   "Rank in category",
   "#6 of 141"
  ],
  [
   "GitHub",
   "panva/jose"
  ],
  [
   "Last change",
   "Nov 18, 2026"
  ]
 ],
 "good": [
  "It only signs, checks and encrypts tokens. Who may log in, sessions, sign-out and permissions are left to your app or a full login library.",
  "Version 6 needs Node.js 20 or newer; older Node.js versions were dropped.",
  "It does not stop you from using a short secret. Use one of 32 random bytes or more, or let jose make one with generateSecret."
 ],
 "checked_line": "Read by AgentGid from 13 official pages, card checked Nov 11, 2026; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/panva.png"
}