Local Storage & IndexedDB
Utilize browser-like storage mechanisms such as `localStorage` and `IndexedDB` for client-side data persistence within your Electron app.
Saving Data in Electron Apps
When building desktop applications with Electron, you often need to save user data or application settings. This is called data persistence.
Unlike web apps that rely on servers, Electron apps can store data directly on the user's computer. This lesson explores two common browser-like storage methods: localStorage and IndexedDB.
Introducing Web Storage API
Electron's renderer processes are essentially web browsers. This means you can use standard browser APIs for data storage, like the Web Storage API.
The Web Storage API provides two main types:
localStorage: Stores data with no expiration date.sessionStorage: Stores data only for the duration of the browser session.
We'll focus on localStorage for persistent data.
All lessons in this course
- Local Storage & IndexedDB
- File System Access
- Embedded Databases with SQLite