iOS 设置
相关域名和 apple-app-site-association.
复制安装提示并包含安装步骤和该插件的完整Markdown指南。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-passkey`
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/passkey/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技能添加到您的AI工具中:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins然后使用以下提示:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-passkey` plugin in my project.如果您更喜欢手动设置,请按照以下命令安装插件,并按照下面的平台特定说明进行操作:
安装包
bun add @capgo/capacitor-passkey同步本机项目
bunx cap sync添加插件配置
import type { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = { appId: 'app.capgo.passkey.example', appName: 'My App', webDir: 'dist', plugins: { CapacitorPasskey: { origin: 'https://signin.example.com', autoShim: true, domains: ['signin.example.com'], }, },};
export default config;在引导期间安装 shim
import { CapacitorPasskey } from '@capgo/capacitor-passkey';
await CapacitorPasskey.autoShimWebAuthn();保持正常的 WebAuthn 流程
const registration = await navigator.credentials.create({ publicKey: registrationOptions,});
const authentication = await navigator.credentials.get({ publicKey: requestOptions,});配置从 plugins.CapacitorPasskey 在 capacitor.config.*.
origin: primary HTTPS relying-party origin used by the shim and direct APIdomains: 需要在本地配置中同步的额外依赖方主机名autoShim: 默认值 true 并控制本地 cap sync 自动配置钩子当你运行 bunx cap sync,插件会更新生成的本机主机项目:
asset_statements 元数据和由清单使用的生成资源钩子不会为你发布网站信任文件。您仍然需要托管:
https://your-domain/.well-known/apple-app-site-associationhttps://your-domain/.well-known/assetlinks.json如果您正在使用 Getting Started 来规划身份验证和帐户流程,连接它与 使用 @capgo/capacitor-passkey 用于在使用 @capgo/capacitor-passkey 中的本机功能 @capgo/capacitor-社会登录 为 @capgo/capacitor-社会登录 的实现细节 @capgo/capacitor-密钥 为 @capgo/capacitor-密钥 的实现细节 @capgo/capacitor-原生生物识别 为 @capgo/capacitor-原生生物识别 的实现细节,以及 双因素认证 为双因素认证的实现细节。