Skip to content

Getting Started

  1. Install the package

    Terminal window
    bun add @capgo/capacitor-app-attest
  2. Sync native projects

    Terminal window
    bunx cap sync
  3. Configure platform requirements

    • Complete iOS setup for App Attest capability and backend verification flow.
    • Complete Android setup for Play Integrity Standard and backend verification flow.

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() and createAssertion() return the same key fields on iOS and Android:

FieldTypeDescription
platform'ios' | 'android' | 'web'Native platform that produced the token
formatAttestationFormatapple-app-attest or google-play-integrity-standard
keyIdstringKey/provider handle used for attestation
tokenstringToken to verify on your backend

Attestation is only useful when verified server-side.

  • Never trust client-only success.
  • Require one-time challenge/payload values from your backend.
  • Verify token, app identity, and replay protections in backend logic.

Use the platform-specific backend guides:

If you are using Getting Started to plan security and compliance, connect it with Using @capgo/capacitor-app-attest for the native capability in Using @capgo/capacitor-app-attest, Encryption for the implementation detail in Encryption, Compliance for the implementation detail in Compliance, Capgo Security Scanner for the product workflow in Capgo Security Scanner, and Capgo Security for the product workflow in Capgo Security.