Using @capgo/capacitor-persistent-account
Capacitor Persistent Account Plugin.
Install
bun add @capgo/capacitor-persistent-account
bunx cap sync
bunx cap sync copies the plugin's native code into your native projects. Run it again after every plugin upgrade.
Import
import { CapacitorPersistentAccount } from '@capgo/capacitor-persistent-account';
API at a glance
| Method | Description |
|---|---|
readAccount |
Reads the stored account data from persistent storage. |
saveAccount |
Saves account data to persistent storage. |
Examples
readAccount()
Reads the stored account data from persistent storage.
import { CapacitorPersistentAccount } from '@capgo/capacitor-persistent-account';
const result = await CapacitorPersistentAccount.readAccount();
if (result.data) {
console.log('Account data:', result.data);
} else {
console.log('No account data found');
}
saveAccount()
Saves account data to persistent storage.
import { CapacitorPersistentAccount } from '@capgo/capacitor-persistent-account';
await CapacitorPersistentAccount.saveAccount({
data: {
userId: '12345',
username: 'john.doe',
email: 'john@example.com'
}
});
Full reference
Keep going from Using @capgo/capacitor-persistent-account
If you are using Using @capgo/capacitor-persistent-account to plan native plugin work, connect it with @capgo/capacitor-persistent-account for the implementation detail in @capgo/capacitor-persistent-account, Getting Started for the implementation detail in Getting Started, Capgo Plugin Directory for the product workflow in Capgo Plugin Directory, Capacitor Plugins by Capgo for the implementation detail in Capacitor Plugins by Capgo, and Adding or Updating Plugins for the implementation detail in Adding or Updating Plugins.