@evva/capacitor-secure-storage-plugin

中文文档
4.0.4发布于 2025/08/12MITTypeScriptESM + CJS零依赖构建来源已验证近 30 天下载 2270

Securely store secrets such as usernames, passwords, tokens, certificates or other sensitive information (strings) on iOS & Android

此软件包已被标记为弃用

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

原始使用文档
文档目录15 节
  1. How to install
  2. Capacitor 7
  3. Capacitor 6
  4. Older versions
  5. Compatibility
  6. iOS 15.0+
  7. Android API Level 29+
  8. Usage
  9. Example
  10. API
  11. Interfaces
  12. Platform specific information
  13. iOS
  14. Android
  15. Web

Capacitor Secure Storage Plugin

NPM Version NPM Downloads NPM Unpacked Size (with version) GitHub last commit GitHub branch check runs EVVA License

[!IMPORTANT] This package was renamed please use the new package name! @evva/capacitor-secure-storage-plugin

Capacitor plugin for storing string values securely on iOS and Android.

How to install

Capacitor 7

npm install @evva/capacitor-secure-storage-plugin
npx cap sync

Capacitor 6

npm install @evva/[email protected]
npx cap sync

Older versions

For version lower than 6 please refer to https://github.com/martinkasa/capacitor-secure-storage-plugin

Compatibility

iOS 15.0+

Android API Level 29+

Usage

import { SecureStoragePlugin } from '@evva/capacitor-secure-storage-plugin';

Example

const key = 'username';
const value = 'hellokitty2';

SecureStoragePlugin.set({ key, value })
  .then(success => console.log(success))
const key = 'username';
SecureStoragePlugin.get({ key })
  .then(value => {
    console.log(value);
  })
  .catch(error => {
    console.log('Item with specified key does not exist.');
  });
async getUsername(key: string) {
  return await SecureStoragePlugin.get({ key });
}

API

Interfaces

SecureStoragePluginInterface

PropType
get(options: { key: string; accessibility?: string; group?: string; isSynchronizable?: boolean; }) => Promise<{ value: string; }>
set(options: { key: string; value: string; accessibility?: string; group?: string; isSynchronizable?: boolean; }) => Promise<{ value: boolean; }>
remove(options: { key: string; accessibility?: string; group?: string; isSynchronizable?: boolean; }) => Promise<{ value: boolean; }>
clear(options?: { accessibility?: string; group?: string; isSynchronizable?: boolean; }) => Promise<{ value: boolean; }>
keys(options?: { accessibility?: string; group?: string; }) => Promise<{ value: string[]; }>
getPlatform() => Promise<{ value: string; }>

Platform specific information

iOS

This plugin uses the SimpleKeychain Swift library for iOS.

Android

On Android, it is implemented using AndroidKeyStore, SharedPreferences, and EncryptedSharedPreferences for enhanced security. This approach uses modern encryption standards to ensure data security on devices with Android Marshmallow and above.

Web

There is no secure storage in browser (not because it is not implemented by this plugin, but it does not exist at all). Values are stored in LocalStorage, but they are at least base64 encoded. Plugin adds 'capsec' prefix to keys to avoid conflicts with other data stored in LocalStorage.

版本与发布记录

@evva/capacitor-secure-storage-plugin 共发布 9 个版本,首次发布于 2024/10/28;过去 12 个月发布了 0 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
4.0.4latest2025/08/121.3 年前
4.0.32025/08/121.3 年前
4.0.22025/02/241.7 年前
4.0.12025/02/201.7 年前
4.0.02025/02/191.7 年前
3.1.02025/02/111.8 年前

关于 @evva/capacitor-secure-storage-plugin 的常见问题

@evva/capacitor-secure-storage-plugin 是什么?

Securely store secrets such as usernames, passwords, tokens, certificates or other sensitive information (strings) on iOS & Android注意:该包已被作者标记为弃用——Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

如何安装 @evva/capacitor-secure-storage-plugin?

在项目目录运行 npm install @evva/capacitor-secure-storage-plugin,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@capacitor/core(^7.0.1)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@evva/capacitor-secure-storage-plugin 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@evva/capacitor-secure-storage-plugin 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@evva/capacitor-secure-storage-plugin 可以商用吗?

@evva/capacitor-secure-storage-plugin 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@evva/capacitor-secure-storage-plugin 的下载量有多少?

根据 npm 官方下载统计,@evva/capacitor-secure-storage-plugin 在 2026/10/14 – 2026/11/12 这 30 天内被下载 2,270 次,日均约 76 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@evva/capacitor-secure-storage-plugin 还在维护吗?

最新版本 4.0.4 发布于 2025/08/12(1.3 年前);至今共发布 9 个版本,其中过去 12 个月发布了 0 个;首次发布于 2024/10/28。作者已将其标记为弃用,新项目建议寻找替代方案。