As @gasaki already mentioned you should use @ionic/storage.
This uses LocalForage when running in a desktop browser only if no “better” option is available or e.g. SQLite when running on a device.
Here is the description:
/**
- Storage is an easy way to store key/value pairs and other complicated
- data in a way that uses a variety of storage engines underneath. Currently,
- Storage uses localforage underneath to abstract away the various storage
- engines while still providing a simple API.
- When running natively, Storage will prioritize using SQLite, as it’s one of
- the most stable and widely used file-based databases, and avoids some of the
- pitfalls of things like localstorage that the OS can decide to clear out in
- low disk-space situations.
- When running in the web or as a Progressive Web App, Storage will attempt to use
- IndexedDB, WebSQL, and localstorage, in that order.
*/