iOSの設定
Associated Domainsと 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アシストによるセットアップでプラグインをインストールできます。以下のコマンドを使用して、お使いのAIツールに Capgo のスキルを追加してください:
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: shimおよび直接の API が使用するプライマリHTTPS relying-party origindomains: sync 時にネイティブ設定へパッチする追加の relying-party ホスト名autoShim: デフォルト値は true およびネイティブの cap sync 自動設定フック実行すると、 bunx cap syncプラグインが生成されたネイティブホストプロジェクトを更新します:
asset_statements メタデータ、および manifest で使用される生成リソースこのフックは Web サイトの trust files を公開しません。以下は引き続き自身でホストする必要があります:
https://your-domain/.well-known/apple-app-site-associationhttps://your-domain/.well-known/assetlinks.jsonバックエンドがすでに WebAuthn JSON を返している場合は、プラグインのメソッドを直接呼び出してください。
import { CapacitorPasskey } from '@capgo/capacitor-passkey';
const registration = await CapacitorPasskey.createCredential({ publicKey: registrationOptionsFromServer,});
const assertion = await CapacitorPasskey.getCredential({ publicKey: requestOptionsFromServer,});使用する isSupported() 古いデバイスでPasskey UIを表示する前に。
iOSの設定
Associated Domainsと apple-app-site-association.
Androidの設定
Digital Asset Linksと assetlinks.json.
バックエンドのメモ
Origin validationとAndroidの注意点。
使用している場合 スタートガイド 認証とアカウントフローを計画するには、これを次と連携させてください @capgo/capacitor-passkey を使用する @capgo/capacitor-passkey の使用におけるネイティブ機能については、 @capgo/capacitor-social-login @capgo/capacitor-social-login の実装の詳細については、 @capgo/capacitor-passkey @capgo/capacitor-passkey の実装詳細については、 @capgo/capacitor-native-biometric @capgo/capacitor-native-biometric の実装の詳細、および 2要素認証 二要素認証の実装の詳細については。