iOSの設定
関連ドメインと apple-app-site-association.
このプラグインのインストール手順とフルマークダウンガイドを含む設定プロンプトをコピーします。
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.
パッケージをインストールする
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,});__CAPGO_KEEP_0__から設定を読み込む plugins.CapacitorPasskey 、 capacitor.config.*.
origin: primary HTTPS relying-party origin used by the shim and direct APIdomains追加のリレーピアホスト名を、ネイティブ設定にSync時にパッチするautoShimデフォルト値は true ネイティブの cap sync 自動設定のハックあなたが実行するとき bunx cap syncプラグインは、生成されたネイティブホストプロジェクトを更新します:
asset_statements メタデータと生成されたリソースがマニフェストによって使用されるホックはあなたのウェブサイトの信頼ファイルを公開しません。まだホストする必要があります:
https://your-domain/.well-known/apple-app-site-associationhttps://your-domain/.well-known/assetlinks.json