@capgo/capacitor-device-integrity
Overview
Section titled “Overview”Device integrity and fraud signals with Widevine, Play Integrity, App Attest, and DeviceCheck
Start with getCapabilities() and the other core methods listed below.
Platform support
Section titled “Platform support”| Platform | Support | Notes |
|---|---|---|
| iOS | Yes | Native |
| Android | Yes | Native |
| Web | Partial | See getting started |
Core Capabilities
Section titled “Core Capabilities”getCapabilities- Returns which integrity features are available on the current platform.getWidevineFingerprint- Returns an Android Widevine-derived device fingerprint.prepareAttestation- Prepares App Attest or Play Integrity state and returns a key or provider handle.createAttestation- Creates a registration attestation token bound to a backend challenge.createAssertion- Creates a request assertion token bound to a backend payload.getDeviceCheckToken- Creates an iOS DeviceCheck token for server-side fraud lookups.
Public API
Section titled “Public API”| Method | Description |
|---|---|
getCapabilities | Returns Widevine, App Attest, DeviceCheck, and Play Integrity support on this device. |
getWidevineFingerprint | Android only. Returns salted SHA-256 fingerprint and optional Widevine metadata. |
prepareAttestation | Prepares native attestation and returns keyId plus format. |
createAttestation | Creates a registration token for a backend-issued challenge. |
createAssertion | Creates an assertion token for a backend-issued payload. |
getDeviceCheckToken | iOS only. Returns a base64 DeviceCheck token. |
Configuration
Section titled “Configuration”Android Play Integrity can use a global Cloud project number in capacitor.config.ts:
plugins: { DeviceIntegrity: { cloudProjectNumber: '123456789012', },},You can also pass cloudProjectNumber to prepareAttestation, createAttestation, and createAssertion.
Source Of Truth
Section titled “Source Of Truth”This reference is synced from src/definitions.ts in capacitor-device-integrity.
Keep going from @capgo/capacitor-device-integrity
Section titled “Keep going from @capgo/capacitor-device-integrity”If you are using @capgo/capacitor-device-integrity to plan security and compliance, connect it with Using @capgo/capacitor-device-integrity for the native capability in Using @capgo/capacitor-device-integrity, Using @capgo/capacitor-app-attest for related attestation flows, @capgo/capacitor-app-attest for implementation detail, Capgo Security Scanner for the product workflow in Capgo Security Scanner, and Capgo Security for the product workflow in Capgo Security.