API reference
Planned JavaScript API of expo-rampart.
Rampart.configure(options)
| Option | Type | Default | Notes |
|---|---|---|---|
checks.include / checks.exclude | ThreatId[] | all | Turn individual signals on or off. |
intervalMs | number | 60000 | Re-check period while in the foreground. 0 = only at start and on resume. |
android.expectedSigningCertSha256 | string[] | — | SHA-256 of your app signing certificate (from Play Console). |
android.allowedInstallers | string[] | ['com.android.vending'] | Installer package names you trust. |
ios.expectedTeamId | string | — | Your Apple Developer Team ID. |
ios.expectedBundleId | string | — | Defaults to the app's bundle ID at build time. |
minOs | { android?: number; ios?: string } | — | Floor for outdatedOs. |
Rampart.runChecks(): Promise<ThreatReport>
Runs every enabled check once, off the UI thread, and resolves with:
type ThreatReport = {
events: ThreatEvent[];
checkedAt: number;
durationMs: number;
};Rampart.addThreatListener(cb): Subscription
Called for each new or changed ThreatEvent. Call subscription.remove() to stop.
useThreats(): ThreatEvent[]
React hook returning the latest events; re-renders only when the set changes.
Rampart.secureScreen.enable() / disable() and <SecureView>
Blocks capture of the current screen. <SecureView> enables protection while mounted.
Rampart.reportServerTime(serverEpochMs)
Give Rampart your backend's time (for example from a response header) so timeSpoofing can measure skew
without Rampart doing any network I/O.
Rampart.reportDigest(report, nonce): string
Returns a hex SHA-256 over a canonical summary of the report and the nonce, for use as the Play
Integrity requestHash or inside the App Attest clientDataHash. See
Server verification.
ThreatId
privilegedAccess · rootHidingTools · hookingFramework · debuggerAttached · tampered ·
untrustedInstaller · emulator · unlockedBootloader · cloneOrVirtualSpace · screenCapture ·
overlay · accessibilityRisk · uiAutomation · untrustedKeyboard · notificationListenerRisk ·
systemVpn · userCaInstalled · mockLocation · timeSpoofing · usbDebugging · developerMode ·
deviceLockMissing · outdatedOs