Svelte Persistent Store screenshot

Svelte Persistent Store

Author Avatar Theme by Macfja
Updated: 29 Jun 2025
253 Stars

A Svelte store that keep its value through pages and reloads

Overview:

The Svelte Persistent store is a Svelte store that allows data to persist through page changes and reloads. It provides multiple built-in storage options and supports working with any Svelte store, classes, objects, and primitives. This library offers an easy way to store and retrieve data across different instances of a Svelte application.

Features:

  • Multiple storages: Allows users to choose the most suitable storage option based on their use case.
  • Work with any Svelte store: Compatible with any Svelte store, providing flexibility in managing data.
  • Work with classes, objects, primitives: Supports storing and retrieving various data types, including classes, objects, and primitives.
  • Built-in storages: Six built-in storage options are available, including localStorage, sessionStorage, cookie storage, indexedDB storage, chrome storage, and encrypted storage.
  • Documentation generation: Documentation and examples can be easily generated using the provided npm scripts.

Installation:

To install the Svelte Persistent store, you can use npm:

npm install @macfja/svelte-persistent-store

Summary:

The Svelte Persistent store is a powerful library that extends the functionality of Svelte stores by providing persistence across pages and reloads. With support for multiple storages and compatibility with different data types, it offers a flexible solution for managing and retrieving data in Svelte applications. The library also includes built-in storage options and the ability to generate documentation and examples for easy integration. Contributions are welcome, and the library is licensed under the MIT License.