Passer au contenu

Getting Started

Ce contenu n'est pas encore disponible dans votre langue.

Terminal window
bun add @capgo/capacitor-persistent-account
bunx cap sync
import { CapacitorPersistentAccount } from '@capgo/capacitor-persistent-account';

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.

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');
}

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.

import { CapacitorPersistentAccount } from '@capgo/capacitor-persistent-account';
await CapacitorPersistentAccount.saveAccount({
data: {
userId: '12345',
username: 'john.doe',
email: 'john@example.com'
}
});

This page is generated from the plugin’s src/definitions.ts. Re-run the sync when the public API changes upstream.