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.
インストール
「インストール」のセクション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-app-attest` plugin in my project.__CAPGO_KEEP_1__の場合、プラグインを次のコマンドを実行してインストールし、以下のプラットフォーム固有の指示に従ってください:
-
__CAPGO_KEEP_2__をインストール
__CAPGO_KEEP_3__画面 bun add @capgo/capacitor-app-attest -
__CAPGO_KEEP_4__
__CAPGO_KEEP_3__画面 bunx cap sync -
__CAPGO_KEEP_5__の要件を設定
- 完了 iOSのセットアップ __CAPGO_KEEP_6__機能とバックエンド検証フローのために必要です。
- Complete Android setup for Play Integrity Standard and backend verification flow.
Why use this plugin
Section titled “Why use this plugin”This plugin provides one cross-platform API while keeping native platform security:
- iOS: Apple App Attest (
DeviceCheck) - Android: Google Play Integrity Standard API
- No custom client-side crypto scheme
- Normalized outputs for backend checks
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' | トークンを生成したネイティブプラットフォーム |
format | AttestationFormat | apple-app-attest または google-play-integrity-standard |
keyId | string | キー/プロバイダーハンドルを使用した証明 |
token | string | バックエンドで検証するトークン |
バックエンドの要件
バックエンドの要件のセクションサーバー側で検証されていないと、証明は有効ではありません。
- クライアントのみの成功は信頼できません。
- バックエンドから1回限りのチャレンジ/ペイロード値を要求してください。
- 検証
tokenバックエンドのロジックでアプリのアイデンティティとリプレイ保護を検証してください。
プラットフォーム固有のバックエンドガイドを使用してください:
Getting Startedから続けてください
Getting Startedのセクションあなたが使用している場合 Getting Started セキュリティとコンプライアンスを計画するには、 @capgo/capacitor-app-attestを使用して @capgo/capacitor-app-attestのネイティブ機能を使用する 暗号化 暗号化の実装詳細 コンプライアンス コンプライアンスの実装詳細 Capgo セキュリティ スキャナー Capgo セキュリティ スキャナーの製品ワークフロー Capgo セキュリティ 製品ワークフローにおけるCapgo セキュリティのための製品。