js-cookie or Strata Storage?
A small client-side JavaScript API for reading, writing and deleting cookies with their attributes.
Last checked 7 Nov 2026. Open js-cookie
Who each one suits.
Choose js-cookie if cookies are the only store you touch and you want every cookie attribute (expires, path, domain, secure, sameSite) exposed directly in 803 bytes gzipped per bundlephobia on 2026-11-07.
Choose Strata Storage if a cookie is one place a value might live and you'd rather read it back with the same storage.get() you use for IndexedDB, the URL and the native stores.
The stores, side by side.
“Not stated” means the pages we checked don’t mention it. It doesn’t mean the library can’t do it.
| Store | js-cookie | Strata Storage |
|---|
| localStorage | Not stated on the pages we checked | Yes |
|---|
| IndexedDB | Not stated on the pages we checked | Yes |
|---|
| sessionStorage | Not stated on the pages we checked | Yes |
|---|
| Cookies | Yes Checked 7 Nov 2026 Source | Yes |
|---|
| URL parameters as a store | Not stated on the pages we checked | Yes |
|---|
| iOS Keychain | Not stated on the pages we checked | Yes |
|---|
| Android secure storage (Keystore-backed) | Not stated on the pages we checked | Yes |
|---|
| Native preferences (UserDefaults / SharedPreferences) | Not stated on the pages we checked | Yes |
|---|
| Web and native stores behind one API | Not stated on the pages we checked | Yes |
|---|
| No runtime dependencies | Yes Checked 7 Nov 2026 Source | Yes |
|---|
Licence, size, downloads.
| Fact | js-cookie | Strata Storage |
|---|
| Licence | MIT Source | MIT Source |
|---|
| npm version | 3.0.8 | 3.1.4 |
|---|
| Bundle size | 803 bytes gzipped, 1,574 minified. For version 3.0.8. Checked 7 Nov 2026 Source | 21,468 bytes gzipped, 79,645 minified. For version 3.1.4. Checked 7 Nov 2026 Source |
|---|
| Weekly downloads | 44,197,779, 31 Oct 2026 to 6 Nov 2026 Source | 486, 31 Oct 2026 to 6 Nov 2026 Source |
|---|
| Cost | Open source under the MIT licence; no price is stated on the pages we checked Source | Free to install and use; the website takes voluntary support of an amount the supporter chooses |
|---|
Coming from js-cookie?
The docs guide lists the calls that change and shows how to carry existing values over. Read the js-cookie guide
All 12 libraries