unstale

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 init

@unstale/cli on npm

js-cookie 324 changes

Breaking changes 12

  • Configured attributes are exposed as an immutable property and cannot be changed to configure the API.

    3.0.0release notes

  • Support for Bower was removed.

    3.0.0release notes

  • Configured converters are exposed as an immutable property and cannot be changed to configure the API.

    3.0.0release notes

  • Creates an API instance configured with predefined cookie attributes.

    3.0.0release notes

  • Returning a falsy value from a custom read converter no longer falls back to the standard internal converter.

    3.0.0release notes

  • Removed defaults; use Cookies.withAttributes() to create an API instance with predefined cookie attributes.

    3.0.0release notes

  • Removed getJSON(); use JSON.parse(Cookies.get('foo')) to parse a cookie value.

    3.0.0release notes

  • Support for IE versions below 10 was dropped.

    3.0.0release notes

  • The main package.json field is no longer used for the UMD variant; browser is used instead.

    3.0.0release notes

  • Building no longer supports Node versions below 12; LTS versions are supported.

    3.0.0release notes

  • set() no longer automatically stringifies JSON values; stringify values before passing them.

    3.0.0release notes

  • Requires an object specifying converter types; passing a function to be used as a read converter is no longer accepted.

    3.0.0release notes

Security 1

New APIs and options 4

  • Exposes default converters so custom converters can explicitly delegate to the standard behavior.

    3.0.0release notes

  • The default path is exposed via the API.

    3.0.0release notes

  • Minified versions were added to the package.

    3.0.0release notes

  • The package.json module field points to an ES module variant, provided in addition to the UMD module.

    3.0.0release notes

Behavior and default changes 1

  • The package.json browser field is used instead of main for the UMD variant.

    3.0.0release notes

Fixes and other changes 6

  • ES5 compatibility was restored after being inadvertently broken in 3.0.7.

    3.0.8release notes

  • The Node version restriction was lifted after 3.0.7 inadvertently restricted Node to version 20 or newer.

    3.0.8release notes

  • Ensures consistent behavior between get('name') and get().

    3.0.7release notes

  • The package is published to npm exclusively through a trusted publisher.

    3.0.7release notes

  • Falsy arguments passed to getters are handled.

    3.0.0release notes

  • Support for URL-encoded cookie values was improved, including case-insensitive encoding.

    3.0.0release notes