npm / js-cookie
js-cookie
What changed in js-cookie 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
12 breaking1 security4 new APIs and options1 behavior and defaults6 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initjs-cookie 324 changes
Breaking changes 12
Configured attributes are exposed as an immutable property and cannot be changed to configure the API.
Support for Bower was removed.
Configured converters are exposed as an immutable property and cannot be changed to configure the API.
Creates an API instance configured with predefined cookie attributes.
Returning a falsy value from a custom read converter no longer falls back to the standard internal converter.
Removed defaults; use Cookies.withAttributes() to create an API instance with predefined cookie attributes.
Removed getJSON(); use JSON.parse(Cookies.get('foo')) to parse a cookie value.
Support for IE versions below 10 was dropped.
The main package.json field is no longer used for the UMD variant; browser is used instead.
Building no longer supports Node versions below 12; LTS versions are supported.
set() no longer automatically stringifies JSON values; stringify values before passing them.
Requires an object specifying converter types; passing a function to be used as a read converter is no longer accepted.
Security 1
Prevents cookie attribute injection associated with CVE-2026-46625.
New APIs and options 4
Exposes default converters so custom converters can explicitly delegate to the standard behavior.
The default path is exposed via the API.
Minified versions were added to the package.
The package.json module field points to an ES module variant, provided in addition to the UMD module.
Behavior and default changes 1
The package.json browser field is used instead of main for the UMD variant.
Fixes and other changes 6
ES5 compatibility was restored after being inadvertently broken in 3.0.7.
The Node version restriction was lifted after 3.0.7 inadvertently restricted Node to version 20 or newer.
Ensures consistent behavior between get('name') and get().
The package is published to npm exclusively through a trusted publisher.
Falsy arguments passed to getters are handled.
Support for URL-encoded cookie values was improved, including case-insensitive encoding.