This plugin allows you to securely store account information for a user in Capacitor, and keep it between reinstall
The most complete doc is available here: https://capgo.app/docs/plugins/persistent-account/
npm install @capgo/capacitor-persistent-account
npx cap syncCapacitor Persistent Account Plugin
Provides persistent storage for account data across app sessions using platform-specific secure storage mechanisms. On iOS, this uses the Keychain. On Android, this uses AccountManager. This ensures account data persists even after app reinstallation.
readAccount() => Promise<{ data: unknown | null; }>Reads the stored account data from persistent storage.
Retrieves account data that was previously saved using saveAccount(). The data persists across app sessions and survives app reinstallation on supported platforms.
Returns: Promise<{ data: unknown; }>
saveAccount(options: { data: unknown; }) => Promise<void>Saves account data to persistent storage.
Stores the provided account data using platform-specific secure storage mechanisms. The data will persist across app sessions and survive app reinstallation. Any existing account data will be overwritten.
| Param | Type | Description |
|---|---|---|
options |
{ data: unknown; } |
- The options object containing the data to save. |
getPluginVersion() => Promise<{ version: string; }>Get the native Capacitor plugin version
Returns the version string of the native plugin implementation. Useful for debugging and ensuring compatibility between the JavaScript and native layers.
Returns: Promise<{ version: string; }>