Skip to content

Getting Started

GitHub

AI-Assisted Setupを使用してプラグインをインストールできます。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.

Manual Setup を使用する場合は、以下のコマンドを実行してください。以下のプラットフォーム固有の指示に従ってください。

  1. パッケージをインストール

    ターミナル画面
    bun add @capgo/capacitor-passkey
  2. ネイティブプロジェクトを同期

    ターミナル画面
    bunx cap sync
  3. プラグイン設定を追加

    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;
  4. ブートストラップ時に shim をインストール

    import { CapacitorPasskey } from '@capgo/capacitor-passkey';
    await CapacitorPasskey.autoShimWebAuthn();
  5. 通常のWebAuthnフローを維持する

    const registration = await navigator.credentials.create({
    publicKey: registrationOptions,
    });
    const authentication = await navigator.credentials.get({
    publicKey: requestOptions,
    });

設定は plugins.CapacitorPasskey in capacitor.config.*.

  • origin: primary HTTPS relying-party origin used by the shim and direct API
  • domains: プラグインの主 HTTPS の依存関係のオリジンに加える補助的な依存関係のホスト名
  • autoShim: 初期値は true と、ネイティブの cap sync 自動設定のハック

あなたのsyncパッチをSyncします

「あなたのsyncパッチをSyncします」

あなたが実行するとき bunx cap sync、プラグインは生成されたネイティブホストプロジェクトを更新します:

  • iOS: 必要に応じて関連ドメインの特権とXcodeの特権のワイヤリング
  • Android: asset_statements メタデータと生成されたリソースがマニフェストによって使用される

このフックはあなたのウェブサイトの信頼ファイルを公開するのをあなたの代わりに行わない。まだあなたはホストする必要があります:

  • https://your-domain/.well-known/apple-app-site-association
  • https://your-domain/.well-known/assetlinks.json

プラットフォームガイド

「プラットフォームガイド」

あなたが 「Getting Started」を使用して 認証とアカウントフローの計画を行う場合、 「Using @capgo/capacitor-passkey」を使用して 「Using @capgo/capacitor-passkey」にnative capabilityを接続する 「@capgo/capacitor-social-login」を使用する for the implementation detail in @capgo/capacitor-social-login, @capgo/capacitor-passkey for the implementation detail in @capgo/capacitor-passkey, @capgo/capacitor-native-biometric for the implementation detail in @capgo/capacitor-native-biometric, and Capacitor-2要素認証の実装詳細のために 編集