Skip to main content

Moving from capacitor-secure-storage-plugin

This plugin does one job: string secrets in the Keychain and in Keystore-backed preferences. If that's all your app stores, keep it. Move when the secure store sits beside others and you want one call shape for all of them.

The calls​

capacitor-secure-storage-pluginStrata Storage
SecureStoragePlugin.set({ key, value })storage.set(key, value, { storage: 'secure' })
SecureStoragePlugin.get({ key }) returns { value }storage.get(key, { storage: 'secure' }) returns the value
SecureStoragePlugin.remove({ key })storage.remove(key, { storage: 'secure' })
SecureStoragePlugin.keys() returns { value }storage.keys(undefined, { storage: 'secure' }) returns the array
SecureStoragePlugin.clear()storage.clear({ storage: 'secure' })

get() on a missing key returns null here. If your code catches a rejection from the plugin to detect a missing key, change that check.

Copy on the device​

import { SecureStoragePlugin } from 'capacitor-secure-storage-plugin';
import { defineStorage } from 'strata-storage';
import { registerCapacitorAdapters } from 'strata-storage/capacitor';

export const storage = defineStorage();

export async function moveSecrets(): Promise<void> {
await registerCapacitorAdapters(storage);
if (await storage.get<boolean>('moved:secure-plugin', { storage: 'secure' })) return;
const { value: keys } = await SecureStoragePlugin.keys();
for (const key of keys) {
const { value } = await SecureStoragePlugin.get({ key });
await storage.set(key, value, { storage: 'secure' });
}
await storage.set('moved:secure-plugin', true, { storage: 'secure' });
}

Don't log these values while you test the copy. Run npx cap sync after installing, or the native module never reaches your projects.

Limits to read first​

The secure adapter doesn't expose Keychain accessibility, a biometric requirement or an authentication prompt (secure adapter). It's native only, too. A browser run won't exercise it, so check the read on each device, and only then remove the plugin's entries with SecureStoragePlugin.clear(), in a later release.

capacitor-secure-storage-plugin as we checked it​

Last checked 7 Nov 2026. "Not stated" means the pages we checked don't mention it, not that the library can't do it. Check capacitor-secure-storage-plugin yourself, or see the side-by-side page.

Store or capabilitycapacitor-secure-storage-pluginStrata Storage
localStoragePartly. On the web values go to localStorage base64-encoded; the README says the browser has no secure storage (source, 7 Nov 2026)Yes
IndexedDBNot stated on the pages we checkedYes
sessionStorageNot stated on the pages we checkedYes
CookiesNot stated on the pages we checkedYes
URL parameters as a storeNot stated on the pages we checkedYes
iOS KeychainYes (source, 7 Nov 2026)Yes
Android secure storage (Keystore-backed)Yes (source, 7 Nov 2026)Yes
Native preferences (UserDefaults / SharedPreferences)Not stated on the pages we checkedYes
Web and native stores behind one APIPartly. One API for the secure store only, string values (source, 7 Nov 2026)Yes
No runtime dependenciesYes. @capacitor/core is a peer dependency (source, 7 Nov 2026)Yes
Package factcapacitor-secure-storage-pluginStrata Storage
LicenceMIT (source)MIT (source)
npm version0.13.03.1.4
Bundle size268 bytes gzipped, 378 minified, version 0.13.0, 7 Nov 2026. JavaScript side only; the native code is not counted by bundlephobia (source)21,468 bytes gzipped, 79,645 minified, version 3.1.4, 7 Nov 2026 (source)
Weekly downloads219,773, 31 Oct 2026 to 6 Nov 2026 (source)486, 31 Oct 2026 to 6 Nov 2026 (source)