@capgo/capacitor-persistent-uuid
Overview
Section titled “Overview”The Persistent UUID plugin creates a random RFC 4122 UUID once and stores it with native persistence. Use it when your app needs a stable, app-scoped identifier that can survive app reinstall flows, Android Studio reinstall cycles, app updates, and device OS updates.
Core Capabilities
Section titled “Core Capabilities”- getId - Read the stored UUID, creating one if none exists for the selected scope.
- resetId - Rotate the UUID for logout, account reset, privacy reset, or test cleanup flows.
- scope - Use a stable namespace when debug and production builds use different package identifiers but should share one identifier.
Platform Storage
Section titled “Platform Storage”| Platform | Storage | Default scope |
|---|---|---|
| Android | AccountManager account owned by the plugin authenticator | App package name |
| iOS | Keychain generic password, device-only accessibility | Bundle identifier |
| Web | localStorage fallback | web |
This is not a hardware identifier. It does not survive factory reset, manual account removal, Keychain clearing, browser storage clearing, or an explicit resetId call.
Public API
Section titled “Public API”| Method | Description |
|---|---|
| getId | Read or create the persistent UUID for a scope. |
| resetId | Replace the stored UUID for a scope. |
| getPluginVersion | Return the native plugin version marker. |
Source Of Truth
Section titled “Source Of Truth”This reference is synced from src/definitions.ts in capacitor-persistent-uuid.
Keep going from @capgo/capacitor-persistent-uuid
Section titled “Keep going from @capgo/capacitor-persistent-uuid”If you are using @capgo/capacitor-persistent-uuid to identify an app install across reinstall flows, connect it with Getting Started for install and usage, Android behavior for AccountManager details, iOS behavior for Keychain details, Using @capgo/capacitor-persistent-uuid for the tutorial, and @capgo/capacitor-persistent-account when you need to persist account data instead of an identifier.