jose: JWT, JWS, JWE and keys, with zero dependencies and one warning
JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes
At a glance
- What is it?
- jose is a JavaScript module for the whole JSON Object Signing and Encryption family: JWT, JWS, JWE, JWK and JWKS, with no runtime dependencies and tree-shakeable ESM output that runs on Node.js, browsers, Cloudflare Workers, Deno and Bun. The design decision worth reading is the module's insistence on naming decode separately from verify, and on listing which algorithms exist per runtime.
- Who is it for?
- jose suits a JavaScript team implementing JWT, JWS or JWE that wants one module across server and edge runtimes, that would rather have no dependency tree than a transitive audit, and that accepts Web API globals as the platform requirement. It does not suit you if you need a Java implementation, and it does not suit you if you want one algorithm everywhere without checking the runtime, since the README says algorithm availability varies per runtime.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 4 days ago.
- What is it written in?
- Mainly TypeScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 22, 2026, and from our analysis. They are not legal advice.
Star history
- panva/jose7,893 ★ · +91
| Repository | 2026-09-22 | 2026-11-22 |
|---|---|---|
| panva/jose | 7.8k | 7.9k |
91 Stars in the last 61 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
Zero dependencies and tree-shakeable ESM are the headline facts
The README has a section titled Dependencies: 0, and the sentence under it is short: `jose` has no dependencies and it exports tree-shakeable ESM.
Both claims matter for the runtimes it targets. There is no transitive tree to audit on a Cloudflare Worker or in a bundle you ship to a browser, and because the output is tree-shakeable, importing one function does not pull in the rest of the surface.
The manifest backs that up: `sideEffects` is false and `type` is module, so a bundler is told the package has no side effects and that its files are ES modules. The internal entry points in the manifest map to a `dist/webapi/` build, which is the Web API based build rather than a Node specific one.
Installation is unremarkable, which is the point. The whole example is one import:
import * as jose from 'jose'and the module is distributed through npm, JSR under the @panva scope, jsDelivr and GitHub.
JWT is one of five formats, and jwtVerify is where you should start
The module covers five related specifications, and the difference between them decides which function you call.
For JSON Web Tokens, the entry point is `jwtVerify`, described as JWT Claims Set Validation and Signature Verification. That is deliberately two things in one call, so a token that verifies cryptographically but has an expired `exp` or a wrong audience still fails.
Verification needs keys, and there are two ways to supply them: `createRemoteJWKSet` for a remote JSON Web Key Set, and `createLocalJWKSet` for one you already hold. Signing is the `SignJWT` class.
Then there is the encrypted branch. `jwtDecrypt` does decryption and claims set validation together, and `EncryptJWT` encrypts. So a JWT in this module is either signed or encrypted, and the two paths have their own verify function for exactly that reason.
decodeJwt is documented as prior to validation, not as a substitute for it
Under the JWT utilities there are two decoders, and one of them carries a warning in its own link text.
`decodeJwt` is described as decoding the JWT Claims Set prior to its validation. That phrasing is the documentation telling you what the function is for: reading a payload you have not checked the signature of.
The other decoder, `decodeProtectedHeader`, appears under every category in the README, JWT, encrypted JWT, JWS, JWE, and it reads the protected header without verifying anything.
The practical consequence is that a codebase with `decodeJwt` in a request handler and `jwtVerify` nowhere has authentication that only looks like authentication. Both functions are exported, both are useful, and only one of them checks a signature.
If you need to route on a claim before verifying, do it after `jwtVerify` rather than instead of it.
Every JWS and JWE operation exists in three serialisations
The JWS section cites RFC 7515 Section 7 and the JWE section cites RFC 7516 Section 7, and both sections are built on the same three serialisation syntaxes.
For signatures, the JWS Compact Serialization and the flattened and general JWS JSON Serialization syntaxes are each covered, which gives you three sign classes and three verify functions:
- Signing: `CompactSign`, `FlattenedSign`, `GeneralSign` - Verification: `compactVerify`, `flattenedVerify`, `generalVerify`
Encryption mirrors it exactly, with `CompactEncrypt`, `FlattenedEncrypt`, `GeneralEncrypt` and the matching `compactDecrypt`, `flattenedDecrypt`, `generalDecrypt`.
The difference between them is the envelope, not the cryptography. Compact is the dot-separated form you see in an `Authorization` header. The JSON forms carry the same content in an object, which is what you need when a key id travels alongside the payload or when you need detached content.
Note the naming asymmetry while you read the API: sign and encrypt are classes with capitals, verify and decrypt are functions with lower-case first letters.
Key import is four functions, not one permissive loader
The key utilities are where a migration usually gets stuck, and the module handles each shape separately.
Import comes in four functions: `importJWK` for a JSON Web Key, `importSPKI` for a public key in SPKI PEM form, `importX509` for an X.509 certificate, and `importPKCS8` for a private key in PKCS #8 form.
Generation is two: `generateKeyPair` for an asymmetric pair and `generateSecret` for a symmetric secret. Export is the mirror of import, with `exportJWK`, `exportPKCS8` and `exportSPKI`.
So converting a certificate you already have means reaching for `importX509`, not `importSPKI`, and exporting a private key means `exportPKCS8`. The README describes the formats collectively as PEM formats like SPKI, X.509 certificate and PKCS #8, as well as JWK.
There are also two conveniences in the other section worth knowing about: `calculateJwkThumbprint` and `calculateJwkThumbprintUri` for key identity, and `EmbeddedJWK` for verification using a key embedded in a JWS header.
Runtime support is per runtime, down to which algorithms exist
The supported runtimes section is unusually careful about its wording, and the caveat is the part to read.
Compatibility is defined as runtimes that support the Web API globals and standard built-in objects the module uses, or that are Node.js. The list is explicitly not exhaustive: Bun, browsers, Cloudflare Workers, Deno, Electron and Node.js.
Then the note that matters: certain algorithms may not be available depending on the runtime used, and the README points at a per-runtime issue for the list of available algorithms, with a separate issue linked for each of those six runtimes.
That is the practical constraint of a Web Crypto based implementation. RSA, ECDSA, EdDSA and the post-quantum key types in the manifest's keyword list do not all exist in every engine's Web Crypto surface, and a module that supports them everywhere cannot promise it.
So the check before you adopt is not whether the runtime is on the list, it is whether the algorithms you need are in that runtime's issue.
The repository tests the runtimes themselves, not just the code
The root directory explains how seriously the runtime claim is taken.
There is `.node_flags.sh` and `.electron_flags.sh`, which are scripts for launching Node.js and Electron under specific flag combinations, and `tap/`, `test-d/` and `test/` for the test suites, with `test-d/` covering types. `playwright.config.ts` is there for the browser runs.
Then the things a maintainer needs: `patches/` for dependency patches, `cookbook/` for recipes, `jsr.json` for the JSR distribution alongside the npm package-lock, `typedoc.json` and `docs/` for the API documentation, `sponsor/` for the sponsor images, `.versionrc.json` and CHANGELOG.md for releases, and SECURITY.md, CONTRIBUTING.md and CODE_OF_CONDUCT.md.
The author is Filip Skokan and the licence is MIT. Releases are frequent patches, v6.2.15 on 2026-11-01 after v6.2.14 on 2026-10-29 and v6.2.13 on 2026-10-20, with the last push on 2026-11-02.
One more corner: `UnsecuredJWT` is exported, for the unsecured token form with no signature, and `JOSE Errors` has its own page, so the error types are documented rather than left to inspection.
Editorial conclusion
jose suits a JavaScript team implementing JWT, JWS or JWE that wants one module across server and edge runtimes, that would rather have no dependency tree than a transitive audit, and that accepts Web API globals as the platform requirement. It does not suit you if you need a Java implementation, and it does not suit you if you want one algorithm everywhere without checking the runtime, since the README says algorithm availability varies per runtime. Verify three things before you adopt it: which runtime you deploy to and which algorithms that runtime's issue lists as available, whether you are using `decodeJwt` where you needed `jwtVerify`, since the documentation labels decoding as happening prior to validation, and that your keys can be imported in a format it accepts, since JWK, SPKI, X.509 and PKCS #8 are separate functions rather than one permissive loader.
Frequently asked questions
What is the difference between JWT and JOSE?
JWT is one of the formats the `jose` module implements, alongside JWS, JWE, JWK and JWKS. Within JWT there are signed tokens, handled by `jwtVerify` and `SignJWT`, and encrypted tokens, handled by `jwtDecrypt` and `EncryptJWT`. JWS and JWE are the lower layers that also work over arbitrary payloads rather than only tokens.
What is JWS used for?
Digital signature and MAC computation and validation over arbitrary JWS payloads. The module supports the JWS Compact Serialization plus the flattened and general JWS JSON Serialization syntaxes from RFC 7515 Section 7, giving you `CompactSign`, `FlattenedSign` and `GeneralSign` for signing and the matching verify functions, with keys from a remote or local JSON Web Key Set.
How can I decode a JWT payload using Jose?
Use `decodeJwt` to read the claims set and `decodeProtectedHeader` to read the protected header, importing them from `jose`. The documentation describes `decodeJwt` as decoding the claims set prior to its validation, so it does not check the signature; use `jwtVerify` when you need claims you have verified.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/panva-jose)Star history chart for your README
[](https://hysenlabs.com/projects/panva-jose)Was this useful?