# joshnuss/svelte-persisted-store

A Svelte store that persists to localStorage

Repository: https://github.com/joshnuss/svelte-persisted-store
Canonical: https://ross.abutalabs.com/products/svelte-persisted-store
Language: TypeScript
License: MIT
License Family: permissive
Topics: svelte, localstorage, pubsub, sessionstorage
Last push: 2026-06-27T11:08:40+00:00

## Health v2 (maintenance only)
Score: 63/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 89, release rhythm 8, longevity 100
- inputs: {"age_days": 2252, "days_push": 67, "days_rel": 671, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1159, forks 39 (observed 2026-08-28T04:03:48.669189+00:00)

## What it is
A Svelte store wrapper that persists state to localStorage or sessionStorage, with optional cross-tab synchronization via storage events. It supports custom serializers, read/write hooks, and error handlers.

## Use cases
- persist user preferences like theme across page reloads
- keep shopping cart contents in localStorage
- sync Svelte store state across browser tabs
- store form drafts in sessionStorage
- reset a persisted store back to its initial value

## When to choose
- you use Svelte or SvelteKit and need state to survive reloads
- you want cross-tab state sync with minimal setup
- you need pluggable serialization or storage backends

## When to avoid
- you need server-side persistence or a database-backed store
- you're not using Svelte's store contract
- you need to persist large datasets beyond localStorage size limits

## Facets
- artifact type: library
- maturity: stable
- function: state-management, serialization
- domain: frontend, web-development, developer-tools
- platform: browser
- tags: svelte, localstorage, sessionstorage, cross-tab-sync, persistence, javascript

## Member repositories
- joshnuss/svelte-persisted-store (main) score 63

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:48.669189+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:31:54.097602+00:00, confidence not recorded.
  - readme: https://github.com/joshnuss/svelte-persisted-store (fetched 2026-08-28T04:03:48.669189+00:00, sha 5dd227a32328)
  - registry_npm: https://registry.npmjs.org/svelte-persisted-store (fetched 2026-08-29T12:36:47.551422+00:00, sha b1fa9b57c52a)
- Data as of 2026-08-30T08:39:29.467469+00:00.
