Getting Started
このプラグインのインストール手順とフルマークダウンガイドを含むセットアッププロンプトをコピーします。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-app-attest`
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/app-attest/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-app-attest -
ネイティブプロジェクトを同期
ターミナルウィンドウ bunx cap sync -
プラットフォーム要件を設定
このプラグインの使用理由
「このプラグインの使用理由」セクションこのプラグインは、ネイティブプラットフォームのセキュリティを維持しながら、1つのクロスプラットフォームAPIを提供します。
- iOS: Apple App Attest (
DeviceCheck) - Android: Google Play Integrity Standard API
- No custom client-side crypto scheme
- バックエンドのチェック用に正規化された出力
使用方法
使用方法import { AppAttest } from '@capgo/capacitor-app-attest';
const support = await AppAttest.isSupported();if (!support.isSupported) { throw new Error(`Attestation not supported on ${support.platform}`);}
const prepared = await AppAttest.prepare();
const registration = await AppAttest.createAttestation({ keyId: prepared.keyId, challenge: 'backend-one-time-registration-challenge',});
const assertion = await AppAttest.createAssertion({ keyId: prepared.keyId, payload: 'backend-one-time-request-payload',});
console.log(registration.platform, registration.format, registration.token);console.log(assertion.platform, assertion.format, assertion.token);統一されたレスポンス形状
統一されたレスポンス形状createAttestation() そして createAssertion() iOSとAndroidの両方で同じキーフィールドを返します。
| フィールド | タイプ | 説明 |
|---|---|---|
platform | 'ios' | 'android' | 'web' | __CAPGO_KEEP_0__ |
format | AttestationFormat | apple-app-attest または google-play-integrity-standard |
keyId | string | __CAPGO_KEEP_1__ |
token | string | __CAPGO_KEEP_2__ |
バックエンドの要件
バックエンドの要件サーバー側で検証する必要があるため、証明は有効です。
- クライアントのみの成功は信頼できません。
- バックエンドから1回限りのチャレンジ/ペイロード値を要求する必要があります。
- バックエンドで検証する必要があります。
token, アプリケーション ID、そしてリプレイ保護をバックエンド ロジックに実装します。
プラットフォーム固有のバックエンド ガイドを使用してください:
「Getting Started」から続けてください
「Getting Started」から続けてくださいあなたが「Using @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-app-attest」を使用している場合 セキュリティとコンプライアンスを計画するには、@__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-app-attestを接続してください 「Using @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-app-attest」で使用するネイティブ機能 「Using @capgo/capacitor-app-attest」で使用するネイティブ機能 for the native capability in Using @capgo/capacitor-app-attest, If you are using 暗号化の実装詳細について 法的要件 __CAPGO_KEEP_0__ セキュリティ スキャナー Capgo セキュリティ スキャナーの製品ワークフローについて Capgo セキュリティ Capgo セキュリティの製品ワークフローについて for the product workflow in Capgo Security.