Migrate from Ionic Secure Storage
此内容尚不支持你的语言。
Ionic Secure Storage is an enterprise plugin for encrypted key-value data. Capgo provides two SQLite-based options depending on your data model and performance needs.
Capgo replacements at a glance
Section titled “Capgo replacements at a glance”| Ionic enterprise plugin | Capgo replacement | Migration guide |
|---|---|---|
| Secure Storage | @capgo/capacitor-fast-sql or @capgo/capacitor-data-storage-sqlite | You are here |
| Auth Connect | @capgo/capacitor-social-login | Auth Connect migration |
| Identity Vault | @capgo/capacitor-native-biometric | Identity Vault migration |
Choose your storage plugin
Section titled “Choose your storage plugin”- Fast SQL: Best for large datasets, sync workflows, or when you want full SQL control and high throughput.
- Data Storage SQLite: Best for simple key-value storage with optional encryption and minimal setup.
If you are unsure, start with Data Storage SQLite for key-value secrets and move to Fast SQL when you need structured data or high-volume writes.
Migration steps
Section titled “Migration steps”- Pick the storage plugin that matches your data model.
- Install the plugin and sync native code.
# Option A: Fast SQLnpm install @capgo/capacitor-fast-sql
# Option B: Data Storage SQLitenpm install @capgo/capacitor-data-storage-sqlite
npx cap sync- Update storage calls to the new API surface. Use the Fast SQL or Data Storage SQLite docs for the exact read/write methods.
- Migrate existing data on first launch by reading values from Ionic Secure Storage and writing them into the new SQLite store.
- Remove Ionic Secure Storage from your dependencies and native configuration.