Skip to Content
Rampart

API reference

Planned JavaScript API of expo-rampart.

Planned API — names may change before 0.1.0.

Rampart.configure(options)

OptionTypeDefaultNotes
checks.include / checks.excludeThreatId[]allTurn individual signals on or off.
intervalMsnumber60000Re-check period while in the foreground. 0 = only at start and on resume.
android.expectedSigningCertSha256string[]—SHA-256 of your app signing certificate (from Play Console).
android.allowedInstallersstring[]['com.android.vending']Installer package names you trust.
ios.expectedTeamIdstring—Your Apple Developer Team ID.
ios.expectedBundleIdstring—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

On this page