Cross-install persistence
Data survives app uninstall/reinstall cycles πΎ
The Capacitor Persistent Account plugin enables secure storage and persistence of user account data between app installations. This plugin ensures that user account information remains available even after app reinstalls, providing seamless user experience and account continuity.
Cross-install persistence
Data survives app uninstall/reinstall cycles πΎ
Secure storage
Secure account data storage with system integration π
Simple API
Clean read/write interface for account management π
Cross-platform
Native iOS and Android implementation π±
npm install @capgo/capacitor-persistent-accountnpx cap sync
saveAccount(options: { data: unknown })
- Securely save account data to persistent storagereadAccount()
- Retrieve stored account data, returns Promise<{ data: unknown | null }>
import { PersistentAccount } from '@capgo/capacitor-persistent-account';
// Define your account data structureinterface UserAccount { userId: string; username: string; email: string; preferences: { theme: string; notifications: boolean; };}
// Save account dataconst accountData: UserAccount = { userId: '12345', username: 'john_doe', email: 'john@example.com', preferences: { theme: 'dark', notifications: true }};
await PersistentAccount.saveAccount({ data: accountData });
// Read account dataconst result = await PersistentAccount.readAccount();if (result.data) { const account = result.data as UserAccount; console.log('Restored account:', account.username);} else { console.log('No account data found');}
Check the complete documentation for detailed implementation guides and best practices.