Using @capgo/capacitor-app-attest
Unified cross-platform attestation plugin for Capacitor.
Install
bun add @capgo/capacitor-app-attest
bunx cap sync
What This Plugin Exposes
isSupported- Checks whether native attestation is available on this device.prepare- Prepares attestation state and returns the key handle used for later calls.createAttestation- Creates a registration attestation token bound to a backend-issued challenge.createAssertion- Creates a request assertion token bound to a request payload.
Example Usage
isSupported
Checks whether native attestation is available on this device.
import { AppAttestNative } from '@capgo/capacitor-app-attest';
const result = await AppAttestNative.isSupported();
console.log(result);
prepare
Prepares attestation state and returns the key handle used for later calls.
import { AppAttestNative } from '@capgo/capacitor-app-attest';
const result = await AppAttestNative.prepare();
console.log(result);
createAttestation
Creates a registration attestation token bound to a backend-issued challenge.
import { AppAttestNative } from '@capgo/capacitor-app-attest';
const result = await AppAttestNative.createAttestation({
keyId: 'key-id-123',
challenge: 'challenge',
});
// The result holds sensitive values: use it without logging it.
createAssertion
Creates a request assertion token bound to a request payload.
import { AppAttestNative } from '@capgo/capacitor-app-attest';
const result = await AppAttestNative.createAssertion({
keyId: 'key-id-123',
payload: 'payload',
});
// The result holds sensitive values: use it without logging it.
Full Reference
- GitHub: https://github.com/Cap-go/capacitor-app-attest/
- Docs: /docs/plugins/app-attest/
Keep going from Using @capgo/capacitor-app-attest
If you are using Using @capgo/capacitor-app-attest to plan security and compliance, connect it with @capgo/capacitor-app-attest for the implementation detail in @capgo/capacitor-app-attest, Getting Started for the implementation detail in Getting Started, Encryption for the implementation detail in Encryption, Compliance for the implementation detail in Compliance, and Capgo Security Scanner for the product workflow in Capgo Security Scanner.