Skip to content

Cap-go/capacitor-persistent-account

@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/

Install

npm install @capgo/capacitor-persistent-account
npx cap sync

API

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()

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(...)

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()

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


About

Capacitor plugin to persist account data between app install

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Contributors 5