Configuration Options
note
The SDK takes no API key. Authentication is handled by a short-lived JWT minted by your backend and passed to verify(). See Authentication.
GuardianOptions
| Field | Type | Default | Platforms | Description |
|---|---|---|---|---|
failurePolicy | FailurePolicy | fail | iOS, Android | What verify() returns when the call fails. React Native does not expose this option and always uses fail. |
logLevel | LogLevel | warn | iOS | Log verbosity. Android ignores this option at initialization and logs at INFO level. |
collectLocation | boolean | false | iOS, Android | GPS collection (requires the location permission) |
collectWifiInfo | boolean | false | Android | WiFi details (requires the location permission). No effect on iOS. |
collectSimCardInfo | boolean | false | Android | SIM/carrier info (requires READ_PHONE_STATE). No effect on iOS. |
collectCameraInfo | boolean | false | Android | Camera count. No permission required. No effect on iOS. |
In React Native, the same options are props of GuardianProvider and fields of GuardianSDK.initialize(), and each one behaves as it does on the underlying platform.
FailurePolicy
failurePolicy applies to verify() only. collect() always returns the error.
| Policy | Behavior |
|---|---|
fail (default) | verify() returns the error. Your code decides what to do. |
allow | verify() returns allowed: true with riskLevel unknown, and the error message in errors. |
custom(handler) | verify() returns the VerificationResult your handler builds from the error. In Swift: .custom { error in ... }. In Kotlin: FailurePolicy.Custom { error -> ... }. |
On iOS the policy applies to every verify() failure. On Android it applies only when the SDK hits an unexpected internal error. A network failure or an HTTP error from Surt is returned as a failure whatever the policy is.