https://github.com/Cap-go/capacitor-persistent-account
Capacitor plugin to persist account data between app install
https://github.com/Cap-go/capacitor-persistent-account
account capacitor ionic plugin
Last synced: about 1 month ago
JSON representation
Capacitor plugin to persist account data between app install
- Host: GitHub
- URL: https://github.com/Cap-go/capacitor-persistent-account
- Owner: Cap-go
- License: mpl-2.0
- Created: 2025-08-11T15:29:58.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2026-02-02T16:40:12.000Z (about 1 month ago)
- Last Synced: 2026-02-03T05:53:14.567Z (about 1 month ago)
- Topics: account, capacitor, ionic, plugin
- Language: Swift
- Homepage: http://capgo.app
- Size: 844 KB
- Stars: 5
- Watchers: 0
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-capacitor - Persistent Account - Securely store account information for a user. ([Capgo plugins](https://capgo.app/) / Authentication & Security)
README
# @capgo/capacitor-persistent-account
This plugin allows you to securely store account information for a user in Capacitor, and keep it between reinstall
## Documentation
The most complete doc is available here: https://capgo.app/docs/plugins/persistent-account/
## Compatibility
| Plugin version | Capacitor compatibility | Maintained |
| -------------- | ----------------------- | ---------- |
| v8.\*.\* | v8.\*.\* | ✅ |
| v7.\*.\* | v7.\*.\* | On demand |
| v6.\*.\* | v6.\*.\* | ❌ |
| v5.\*.\* | v5.\*.\* | ❌ |
> **Note:** The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v8 for Capacitor 8). Only the latest major version is actively maintained.
## Install
```bash
npm install @capgo/capacitor-persistent-account
npx cap sync
```
## API
* [`readAccount()`](#readaccount)
* [`saveAccount(...)`](#saveaccount)
* [`getPluginVersion()`](#getpluginversion)
Capacitor 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()
```typescript
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(...)
```typescript
saveAccount(options: { data: unknown; }) => Promise
```
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()
```typescript
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; }>
--------------------