Skip to main content
@capgo/capacitor-persistent-account Auth & Security Open source

Persistent Account Capacitor plugin

Preserve user authentication and account data across app reinstalls and updates

Install

bun add @capgo/capacitor-persistent-account bunx cap sync
npm, pnpm or yarn
  • npm install @capgo/capacitor-persistent-account
  • pnpm add @capgo/capacitor-persistent-account
  • yarn add @capgo/capacitor-persistent-account

Guide

How to use Persistent Account in Capacitor

Test on device

Download the Capgo app, then scan the QR code.

Persistent Account plugin preview QR code

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.

FAQ

Persistent Account plugin FAQ

How do I install the Persistent Account plugin in a Capacitor app?

Run "bun add @capgo/capacitor-persistent-account" (or "npm install @capgo/capacitor-persistent-account"), then run "bunx cap sync" so the iOS and Android projects pick up the native code. Import it from "@capgo/capacitor-persistent-account" in your app code.

Does @capgo/capacitor-persistent-account work with React, Vue and Angular?

Yes. Persistent Account is a Capacitor package, so it works with any web framework that runs inside Capacitor, including Ionic, React, Vue, Angular, Svelte and plain JavaScript.

Which Capacitor version does @capgo/capacitor-persistent-account support?

Capgo plugins follow Capacitor's major version: use the plugin major version that matches your Capacitor major version (for example plugin v8 with Capacitor 8). The compatibility table in the GitHub README lists the maintained versions.

Is @capgo/capacitor-persistent-account free and open source?

Yes. The source code is public on GitHub at https://github.com/Cap-go/capacitor-persistent-account/ and the package is free to install from npm. Bug reports and pull requests are welcome.

Can I update code that uses Persistent Account without an App Store review?

Installing or upgrading the plugin changes native code, so it needs a new store build. After that, JavaScript, HTML and CSS changes that call the plugin can ship instantly with Capgo live updates.

Ship Persistent Account changes without waiting for app review

Once the plugin is in your store build, Capgo live updates push your JavaScript, HTML and CSS changes to users in minutes.

Start with Capgo