Skip to main content
  • Name: LocalForage
  • Category: Browser Key-Value store

Configuration

The localForage store needs to be initialized with the localForage configuration options.

Usage

localForage only integrates with the browser hence it cannot be used with either @configu/cli or @configu/proxy and can only be used directly.

Example SDK usage

Common errors and solutions

  1. Driver unsupported error
    • Solution: Verify that the selected driver (e.g., IndexedDB) is supported by the browser. If not, fallback to localStorage or WebSQL:
  2. Storage quota exceeded
    • Solution: Reduce the amount of data stored, or prompt the user to free up space. IndexedDB generally provides more storage space than localStorage.
  3. Version conflict
    • Solution: Ensure the version specified in the configuration matches the current database version. If changing schema, increment the version number.
  4. Data persistence issues
    • Solution: Verify that the store name and driver configuration are correct. Use the browser’s DevTools to inspect the storage.

References