You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
deps: webcrypto-core ^2.0.0, @peculiar/asn1-schema ^3.0.0 and @peculiar/json-schema ^3.0.0 are peer dependencies (1.x depended on webcrypto-core ^1.9.2, @peculiar/asn1-schema ^2.7.0 and @peculiar/json-schema ^1.1.12), and @peculiar/utils moves from ^2.0.2 to ^4.1.0. webcrypto parses keys with classes that webcrypto-core registers in the asn1-schema and json-schema storages, and CryptoKey is webcrypto-core's class, so an app needs exactly one copy of each. npm 7+ installs peers automatically; a conflicting major now fails at install (ERESOLVE) instead of at runtime. Code that uses webcrypto-core 1 next to webcrypto 2 gets a second core copy, and its CryptoKey class does not match the one webcrypto 2 exports.
@peculiar/webcrypto is ESM-only and requires Node.js ^20.19.0 || >=22.12.0 (was >=14.18.0). The bundles build/webcrypto.js (CommonJS) and build/webcrypto.es.js and the hand-written index.d.ts are replaced by unbundled ES modules with build/index.js and build/index.d.ts as the entry point; the react-native field is removed. Deep imports into build/ stay blocked by exports. CommonJS code can still require("@peculiar/webcrypto") on supported Node.js versions through require(esm); Node.js 22.0-22.11 can't. require() and import now load the same module, so CryptoKey instanceof checks and keys work across both. TypeScript projects that compile to CommonJS need "module": "node20" or "nodenext". The exported names (Crypto, CryptoKey) are unchanged; their declarations are now generated, so Crypto shows its webcrypto-core base class. See "Breaking Changes In v2" in the README.
Build System
deps: move webcrypto-core, asn1-schema and json-schema to peer dependencies (0a32299)
ship ESM-only output for Node.js ^20.19.0 || >=22.12.0 (c82e321)