Skip to content

jose 4.0.0

⚠ BREAKING CHANGES

  • All module named exports have moved from subpaths to just "jose". For example, import { jwtVerify } from 'jose/jwt/verify' is now just import { jwtVerify } from 'jose'.
  • All submodule default exports and named have been removed in favour of just "jose" named exports.
  • typescript: remove repeated type re-exports
  • The undocumented jose/util/random was removed.
  • The jose/jwk/thumbprint named export is renamed to calculateJwkThumbprint, now import { calculateJwkThumbprint } from 'jose'
  • The deprecated jose/jwk/parse module was removed, use import { importJWK } from 'jose' instead.
  • The deprecated jose/jwk/from_key_like module was removed, use import { exportJWK } from 'jose' instead.

Migration Guide

Migrating from v3.x to v4.x is very straight forward.

  1. All import statements, require(), or import() invocations should be changed to use just 'jose' as the target.
  2. There are no more default exports. Everything was converted to a named export.
  3. Refer to the documentation if you're not sure how a given module should be imported / required.
  4. any custom resolvers targeting jose dist files for jest, typescript, or other tooling should be removed
// before (v3.x)
import { jwtVerify } from 'jose/jwt/verify'
import { SignJWT } from 'jose/jwt/sign'
import * as errors from 'jose/util/errors'

// after (v4.x)
import { jwtVerify, SignJWT, errors } from 'jose'