快速入门
复制包含安装步骤和该插件完整 Markdown 指南的配置 prompt。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-ssl-pinning`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/ssl-pinning/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
安装
“安装”章节你可以使用我们的 AI 辅助设置来安装插件。使用以下命令将 Capgo skills 添加到你的 AI 工具中:
bunx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins然后使用以下 prompt:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-ssl-pinning` plugin in my project.如果你更想手动设置,请运行以下命令安装插件,并按照下方各平台的说明操作:
bun add @capgo/capacitor-ssl-pinningbunx cap sync导入
“导入”章节import { SSLPinning } from '@capgo/capacitor-ssl-pinning';快速入门
章节标题为“快速入门”import { SSLPinning } from '@capgo/capacitor-ssl-pinning';
const result = await SSLPinning.getConfiguration();console.log(result);常见坑点
章节标题为“常见陷阱”- 原生同步:运行
bunx cap sync在插件升级后。 - 唯一可信来源:信任
src/definitions.ts在 GitHub 仓库中。
API 概览
章节标题:“API 概览”getConfiguration
“getConfiguration” 章节返回插件当前可见的 Native 配置。
import { SSLPinning } from '@capgo/capacitor-ssl-pinning';
const result = await SSLPinning.getConfiguration();console.log(result);类型参考
“类型参考” 章节SSLPinningConfigurationState
标题为“SSLPinningConfigurationState”的章节当前对插件可见的静态 SSL pinning 配置。
export interface SSLPinningConfigurationState { /** * Whether at least one certificate is configured for native pinning. */ configured: boolean;
/** * Certificate paths from `capacitor.config.*` relative to the app root. */ certs: string[];
/** * Fully-qualified URLs that should bypass SSL pinning. */ excludedDomains: string[];}PluginVersionResult
标题为“PluginVersionResult”的章节插件版本 payload。
export interface PluginVersionResult { /** * Version identifier returned by the platform implementation. */ version: string;}单一事实来源
标题为“单一事实来源”的部分本页面由插件的 src/definitions.ts生成。当上游的公共 API 发生变化时,请重新运行 sync。
从入门指南继续
“从入门指南继续”章节如果你正在使用 快速入门 来规划安全与合规,请结合 使用 @capgo/capacitor-ssl-pinning 用于“使用 @capgo/capacitor-ssl-pinning”中的原生能力, 加密 了解 Encryption 的实现细节, 合规性 了解合规部分的实现细节, Capgo 安全扫描器 用于 Capgo Security Scanner 中的产品工作流,以及 Capgo 安全 用于 Capgo Security 中的产品工作流。