Fraud is available on the Enterprise plan.

Quickstart
First, sign up for Radar and get an API key. Then, enable Fraud on the Settings page. From there, integrate the SDK, complete the steps below, and callRadar.trackVerified() or Radar.startTrackingVerified(). Radar will perform fraud and jurisdiction checks as described below.
How it works
You can callRadar.trackOnce() to accurately detect a user’s current geofences, current place, or current country and state.
However, users can spoof a device’s location. For example, a gaming app user may spoof their location to access sports betting features only available in specific states. Or, a retail app user may spoof their location to access offers only available inside a store geofence.
To ensure you can trust a user’s location, you can call Radar.trackVerified() instead. Radar will collect a variety of fraud signals and perform fraud and jurisdiction checks, calculating flags and a signed geolocation token that you can use for fraud detection and geo-compliance in your app.
Fraud flags
If fraud detection is enabled, Radar exposes the following flags inuser.fraud:
mocked: Indicates whether a user’s location is being mocked, such as in a simulator or using a location spoofing app (e.g., Fake GPS location).jumped: Indicates whether the user moved too far too fast (e.g., “jumped” across the country in only a few seconds).compromised: Indicates whether the user’s device or app has been compromised (e.g., rooted, jailbroken). On Android, uses the Play Integrity API.inaccurate: Indicates whether the user’s location accuracy is too low to pass verification.sharing: Indicates whether the user is using screen sharing or remote desktop software (e.g., using TeamViewer).proxy: Indicates whether the user’s IP address is a known proxy or VPN.verified: Indicates whether the request was made withRadar.trackVerified().
user.fraud.passed flag that indicates whether all fraud checks passed.
Additionally, the lastMockedAt, lastJumpedAt, lastCompromisedAt, lastInaccurateAt, lastProxyAt, and lastSharingAt timestamps indicate the last time that the user failed each fraud check.
Finally, more detailed failure reasons are also exposed.
Bypassing checks for testing
If desired, you can bypass fraud checks for individual users using the Mark as Bypassed button on the user detail page. If a user is marked as bypassed,user.fraud.bypassed = true and user.fraud.passed = true, regardless of whether the user passes fraud checks.
Blocking users and devices
You can manually block a user or device using the Blocked button on its detail page. If a user is blocked,user.fraud.blocked = true and user.fraud.passed = false, regardless of whether the user passes fraud checks.
You can also block users and devices or unblock them using the API.
These API endpoints must be enabled for your project. Contact your customer success manager for access.
Allowed states and countries
With Regions, you can mark specific countries or states as allowed or blocked to comply with regulations. For example, a sportsbook or daily fantasy sports app may only be allowed to operate in specific US states. Radar exposes your settings inuser.country.allowed and user.state.allowed.
Additionally, you can enable buffer zones and exclusion zones for different states. If buffer zones and exclusion zones are enabled, user.state.inBufferZone and user.state.inExclusionZone indicates whether the user is within a buffer zone or exclusion zone.
While you can work with individual flags, Radar also exposes user.state.passed and user.country.passed flags that indicate whether all jurisdiction checks passed.
Finally, more detailed failure reasons are also exposed.
Contact your customer success manager for access to buffer zones and exclusion zones.
Platform-specific configuration
SDK compatibility
Starting with Android SDK version3.39.0 and iOS SDK version 3.44.0, you must use a compatible Fraud SDK plugin version. Use the table below to select compatible core SDK and plugin versions.
If using React Native, see React Native for how to install the plugins.
Android
Install plugin
If using Android SDK version3.25.0 or higher, you must install an additional plugin. Use the SDK compatibility table to select compatible core SDK and plugin versions.
Add the plugin to the dependencies section of your app’s build.gradle file:
Radar.trackVerified() will return ERROR_PLUGIN.
Initialize SDK
To support thesharing flag on Android, pass fraud = true to RadarInitializeOptions in Radar.initialize():
4.2.0, Radar.trackVerified() retries against a backup host by default when the primary host doesn’t return a response from Radar. To opt out, pass trackVerifiedAutoFailover = false to RadarInitializeOptions. In earlier versions, pass trackVerifiedAutoFailover = true to turn on failover.
Play Integrity API
To support thecompromised flag on Android, enable the Play Integrity API on the Settings page.
If the user’s device or app does not meet basic integrity checks, user.fraud.compromised = true.
You must add the Play Integrity API dependency before calling Radar.trackVerified().
Add the dependency to the dependencies section of your app’s build.gradle file:
Radar.trackVerified() returns ERROR_FORBIDDEN, check the logs. The Play Services version on the device may be out of date.
SSL pinning
To enable SSL pinning and prevent man-in-the-middle attacks, add ares/xml/network_security_config.xml file:
iOS
Install plugin
If using iOS SDK version3.26.0 or higher, you must install an additional plugin. The plugin requires iOS 15 or higher. Use the SDK compatibility table to select compatible core SDK and plugin versions.
In Xcode, go to File > Swift Packages > Add Package Dependency. Enter https://github.com/radarlabs/radar-sdk-ios-fraud-spm.git for the Package Repository URL.
Radar.trackVerified() will return ERROR_PLUGIN.
Initialize SDK
To enable automatic failover oftrackVerified() requests to a secondary host if the primary host is unreachable, set trackVerifiedAutoFailover = true on RadarInitializeOptions:
App Attest
To support thecompromised flag on iOS, enable App Attest and configure a list of valid App IDs (e.g., A1B2C3D4E5.com.yourapp.app1,A1B2C3D4E5.com.yourapp.app2) on the Settings page.
If App Attest indicates that the user’s device or app has been compromised, user.fraud.compromised = true.
App Attest requires iOS 14 and above. If Radar.trackVerified() returns ERROR_FORBIDDEN, check the logs. The iOS version on the device may not support App Attest.
SSL pinning
To enable SSL pinning and prevent man-in-the-middle attacks, add the following to yourInfo.plist file:
React Native
Install plugin
If using React Native SDK version4.0.0 or higher, you must opt in to the fraud plugin on each platform. react-native-radar bundles a compatible iOS plugin. On Android, use the plugin version from the SDK compatibility table.
If using Expo, set iosFraud and androidFraud in the react-native-radar plugin options in app.json, then run npx expo prebuild --clean:
io.radar:sdk-fraud and the Play Integrity API dependency to android/app/build.gradle only if they are not already present. If you are upgrading and your build.gradle has an older io.radar:sdk-fraud version, update it to a compatible version or run npx expo prebuild --clean.
If not using Expo, add the iOS plugin to the app target in your ios/Podfile, then run pod install:
dependencies section of android/app/build.gradle:
Radar.trackVerified() will return ERROR_PLUGIN.
Initialize SDK
Passtrue as the second argument to Radar.initialize() to enable fraud detection. This is required to support the sharing flag on Android.
If using React Native SDK version 4.38.0 or higher, you can enable automatic failover of trackVerified() requests to a secondary host if the primary host is unreachable by passing trackVerifiedAutoFailover: true in the options:
iosFraud and androidFraud also configure SSL pinning for api-verified.radar.io. If not using Expo, configure SSL pinning as described in the Android and iOS sections above, including api-verified.radar.com if automatic failover is enabled.
Web and desktop
Install plugin
If using web SDK version5.0.0 or higher, you must install an additional plugin.
In an HTML page, add the SDK script and the plugin script:
Companion apps and no-download solution
The web SDK supports a companion app solution and a pure-JavaScript no-download solution. The companion app solution uses the Radar Verify apps to support remote desktop detection with thesharing flag, more advanced mocked and proxy detection, and more stable device IDs. Download the Radar Verify Mac app or the Radar Verify Windows app. By default, Radar.trackVerified() expects the Radar Verify app to be running and returns ERROR_VERIFY_APP if it is not.
To skip the Radar Verify app and use the no-download solution, pass { skipVerifyApp: true } to Radar.trackVerified(), Radar.startTrackingVerified(), and Radar.getVerifiedLocationToken().
Contact your customer success manager to learn how you can customize the Radar Verify app installer or branding.
Native desktop SDKs
A native Mac SDK (supporting macOS 12.4+), a native Windows SDK (supporting Windows 10+ and .NET 8+), and an Electron plugin are available.Contact your customer success manager for access to desktop SDKs.
Verifying user locations
Once the above configuration is complete, you can perform location checks and verify a user’s location with just a few lines of code. Choose your implementation pattern depending on your use cases:- Less regulated gaming implementations, non-US gaming implementations, and non-gaming implementations should generally choose Manual location checks and, on web, the no-download solution.
- US sportsbook and iGaming implementations should generally choose Automatic location checks with caching and, on web, the companion app solution.
Manual location checks
You can callRadar.trackVerified() to manually perform a location check. Radar.trackVerified() returns a RadarVerifiedLocationToken with:
passed: A boolean indicating whether the user passed all fraud and jurisdiction checks (user.fraud.passed && user.country.passed && user.state.passed).token: A tamper-proof JSON Web Token (JWT) that you can send to your server to validate the signature, signed with the JSON Web Token (JWT) Secret Key found under Fraud on the Settings page. With encrypted responses,tokenis a JSON Web Encryption (JWE) token instead.failureReasons: Ifpassed == false, an array of more detailed failure reasons.expiresAt: The datetime when the token expires, by default in 20 minutes, but earlier when close to the border based on compliance requirements.expiresIn: The number of seconds until the token expires.user: The user, with detailed information inuser.fraud,user.country, anduser.state.events: The events generated, if any.
reason to Radar.trackVerified() to specify the reason for performing the location check (e.g., "login", "signup", "withdrawal"). Location check reasons are exposed in filters, reports, and rules.
Ranging beacons
On iOS and Android, you can passbeacons: true to Radar.trackVerified() to range nearby beacons and include them in the location check. By default, each call waits up to 5 seconds to range beacons. The wait ends early only if every nearby beacon is found.
If you need beacon ranging often, call Radar.startRangingBeacons() before the location check. The SDK then ranges nearby beacons continuously while the app is in the foreground and searches for nearby beacons again every 60 seconds. Radar.trackVerified(beacons: true) uses the beacons seen in the last 5 seconds instead of starting a new ranging window.
Call Radar.startRangingBeacons() after initializing the SDK and after the user grants location permissions (and, on Android, Bluetooth permissions). To limit battery use, call it when the user enters the flow that calls Radar.trackVerified(beacons: true), and call Radar.stopRangingBeacons() when they leave it. Ranging pauses automatically when the app goes to the background and resumes when it returns to the foreground.
Radar.startRangingBeacons() and Radar.stopRangingBeacons() require iOS SDK 3.43.0+ or Android SDK 3.38.0+. Android requires Android 8.0 (API level 26) or later.Automatic location checks with caching
You can callRadar.startTrackingVerified() to automatically perform location checks on connection changes, on the specified interval, or more frequently if token.expiresIn < interval (based on current state, distance to border, and so on).
Instead of calling Radar.trackVerified(), which always fetches a fresh location token, you can call Radar.getVerifiedLocationToken(), which returns a cached location token immediately if the last location token is still valid, or fetches a fresh location token if not.
If you set a delegate on iOS with Radar.setVerifiedDelegate() or a receiver on Android with Radar.setVerifiedReceiver(), fresh location tokens are also delivered to RadarVerifiedDelegate.didUpdateToken() and RadarVerifiedReceiver.onTokenUpdated(), respectively.
For example, to automatically verify the user’s location at least every 20 minutes (1200 seconds), without ranging beacons:
Setting product type
You can configure multiple product types within a project, each with its own allowed states and countries and other settings. CallRadar.setProduct(product) to pass the product type before performing a location check.
Contact your customer success manager for help configuring product types and allowed jurisdictions.
Setting expected jurisdiction
In addition to setting allowed states and countries, you can optionally set an expected jurisdiction and fail location checks outside of that jurisdiction regardless of whether that jurisdiction is allowed in settings. CallRadar.setExpectedJurisdiction(expectedCountryCode, expectedStateCode) to set the expected jurisdiction before performing a location check.
Setting expected address
Contact your customer success manager to enable address verification on your project.
Radar.setExpectedAddress(address) to set the expected address before performing a location check. Radar sends the address with each subsequent location check until you call Radar.setExpectedAddress(nil) (null on Android).
Setting an expected address is supported on iOS SDK version 3.42.0 or higher and Android SDK version 3.38.0 or higher.
user.expectedAddress:
expectedAddress: The expected address, as passed toRadar.setExpectedAddress().formattedAddress: The formatted address, as geocoded by Radar. May benilif the address could not be geocoded.latitude: The latitude of the geocoded address. May benilif the address could not be geocoded.longitude: The longitude of the geocoded address. May benilif the address could not be geocoded.atAddress: A boolean indicating whether the user is within the distance threshold of the geocoded address. The threshold is 60 meters by default.distance: The distance in meters between the user’s location and the geocoded address. May benilif the address could not be geocoded.confidence: The confidence ofatAddress, one ofhigh,medium,low, orunknown. Confidence accounts for the accuracy of the user’s location and the uncertainty of the geocoded address.highmeans the result holds even at the edge of that uncertainty,lowmeans the uncertainty is more than twice the distance threshold, andunknownmeans the address could not be geocoded or the location accuracy was not available.
address_not_expected warning. Unlike failure reasons, this warning does not cause the location check to fail, so passed is unaffected. Use user.expectedAddress.atAddress and user.expectedAddress.confidence to decide how to handle the result in your app.
Contact your customer success manager to change the distance threshold.
Auth tokens
Contact your customer success manager to access temporary auth tokens and/or disable publishable API keys on your project.
ttl and optional constraints (e.g., product, expectedCountryCode, expectedStateCode) as claims.
Auth tokens are supported on iOS SDK version 3.28.0 or higher, Android SDK version 3.27.0 or higher, and web SDK version 5.1.0 or higher.
First, create an EC P-256 key pair. Save your private key. Your private key should never leave your server. Copy your public key. For example:
BEGIN and END lines.
To create an auth token, sign a JWT using ES256 on your server. The payload should include now for iat, now + ttl for exp, the public key Key ID from the dashboard for kid, and any optional constraints as claims. For example:
Radar.trackVerified() will return ERROR_UNAUTHORIZED. If any of the claims don’t match, Radar.trackVerified() will return ERROR_FORBIDDEN.
Encrypted responses
Contact your customer success manager for access to encrypted responses.
token is a JWT signed with a secret key that Radar and your server share. As an alternative, Radar can return token as a JSON Web Encryption (JWE) token. Radar signs the response with its own private key, then encrypts it with a public key that you upload. Only your server can decrypt the response.
Encrypted responses are available for Radar.trackVerified() and Radar.revealRisk().
With encrypted responses, Radar returns only token, passed, expiresAt, and expiresIn to the client. Everything else, including user, events, and failureReasons for location checks and risk, network, and device for risk checks, is only in the encrypted token. Send the token to your server to read it.
First, create an EC P-256 key pair. Save your private key. Your private key should never leave your server. Then convert your public key to a JSON Web Key (JWK) and copy it. For example:
d field, you’ll see the error Enter a public P-256 JWK without private key material.
A new key is disabled until you activate it. Once your server has the private key, open the menu on the key’s row and click Activate. Only one key is active per environment, and live and test keys are separate. You need the owner role to add, activate, or delete keys.
To read a response, decrypt the token on your server with your private key, then verify Radar’s signature on the decrypted JWT. Radar encrypts with ECDH-ES and A256GCM, and signs with ES256. Radar’s public signing keys are published at https://api.radar.io/.well-known/jwks.json. For example, in JavaScript:
result: The response. For location checks, this has the same fields as the default JWT payload, includinguser,events,passed, andfailureReasons.endpoint:trackforRadar.trackVerified()orrevealRiskforRadar.revealRisk().live: A boolean indicating whether the response is from the live or test environment.aud: Your Radar project ID.exp: The time when the token expires.
kid header of each token is the Key ID of the key that encrypted it, so your server can choose the matching private key. You can delete a key once it’s disabled.
Failure reasons
Some more sensitive or proprietary failure reasons are not documented here. Contact your customer success manager for more information.
passed == false, responses include an array of more detailed failure reasons.
country_not_allowed: The user’s location is in a country that is not allowed based on jurisdiction settings.country_not_expected: The user’s location is in a country that is not expected based onRadar.setExpectedJurisdiction().country_in_buffer_zone: The user’s location is too close to the border of a country, either based on a jurisdiction-specific threshold or based on the location accuracy reported by the device (i.e., a “radius of uncertainty” that overlaps a country border).country_in_exclusion_zone: The user’s location is in a country-specific exclusion zone, if enabled.state_not_allowed: The user’s location is in a state or province that is not allowed according to jurisdiction settingsstate_not_expected: The user’s location is in a state or province that is not expected according toRadar.setExpectedJurisdiction().state_in_buffer_zone: The user’s location is too close to the border of a state or province, either based on a jurisdiction-specific threshold or based on the location accuracy reported by the device (i.e., a “radius of uncertainty” that overlaps a state or province border).state_in_exclusion_zone: The user’s location is in a state- or province-specific exclusion zone, if enabled.fraud_blocked_user_id: TheuserIdof the user is blocked (all platforms).fraud_blocked_device_id: ThedeviceIdof the user is blocked (all platforms).fraud_blocked_ip: The IP of the user is blocked (all platforms).fraud_blocked_mac_address: The MAC address of the user is blocked (macOS and Windows only).fraud_blocked_risk_score_auto_block: The user or device was automatically blocked based on a high risk score (all platforms).fraud_compromised_jailbroken: The user’s iOS device is jailbroken (iOS only).fraud_compromised_app_attest: The user’s iOS device failed App Attest checks (iOS only).fraud_compromised_play_integrity_api: The user’s Android device failed Play Integrity API basic integrity checks (Android only).fraud_mocked_from_mock_provider: The user’s location is mocked or spoofed according to iOS, Android, macOS, or Windows location services (all platforms).fraud_mocked_known_spoofing_app: The user’s device is running a known location spoofing app (macOS and Windows only).fraud_mocked_inconsistent_ip_country: The user’s location is in a country inconsistent with the IP geolocation country (all platforms).fraud_jumped_single_device: The user’s location moved too far too fast (e.g., “jumped” across the country in a few seconds), possibly indicating impossible travel (all platforms).fraud_jumped_multiple_devices: The device’s location is inconsistent with another device’s location with the sameuserId, possibly indicating account sharing (all platforms).fraud_inaccurate_exceeded_accuracy_threshold: The user’s location accuracy reported by the device is too low and exceeds a specified threshold (all platforms).fraud_sharing_known_screen_sharing_app: The user’s device is running a known screen sharing or remote desktop app (macOS and Windows only).fraud_sharing_multiple_displays: The user’s Android device has multiple displays, indicating possible screen sharing (Android only).fraud_sharing_virtual_input_device: The user’s Android device has a virtual input device, indicating possible screen sharing (Android only).fraud_proxy_known_proxy_ip: The user’s IP address is a known proxy or VPN (all platforms).fraud_proxy_network_configuration: The user’s network configuration indicates the use of a proxy or VPN (macOS and Windows only).
Troubleshooting
To troubleshoot a failed geolocation check, go to the Locations page. Use the Filters button to filter down to specific user IDs, IP addresses, or jurisdictions, and use the date filters to filter down to specific dates or times. Click on a specific geolocation check to see all the details, including a map view, failure reasons, detailed user, device, IP, and jurisdiction information, and more.If you need help, please contact your customer success manager.
Revealing device and network risk
Contact your customer success manager for access.
@radarlabs/plugin-fraud version 1.4.0 or higher, iOS SDK version 3.38.0 or higher, Android SDK version 3.35.0 or higher, or React Native SDK version 4.36.0 or higher, you can call Radar.revealRisk() to reveal device and network risk signals before verifying a user’s location.
Radar.revealRisk() returns a RadarRevealRiskToken with:
risk: Risk information, including a risklevel(none, low, medium, high, configurable with Risk scores) andreasons(includesproxy,compromised, andsharingreasons from Failure reasons).network: Network information, including IP address, IP geolocation, privacy information, and ASN information.device: Device and browser information.token: A tamper-proof JSON Web Token (JWT) that you can send to your server to validate the signature, signed with the JSON Web Token (JWT) Secret Key found under Fraud on the Settings page. With encrypted responses,tokenis a JSON Web Encryption (JWE) token instead.expiresAt: The datetime when the token expires.expiresIn: The number of seconds until the token expires.
Risk scores
You can use risk scores to identify high-risk users and devices. By default, risk score weights are based on a “strikes” system:- No strikes = none
- 1 strike = low
- 2 strikes = medium
- 3 strikes = high
mocked,jumped,compromised,sharing, andproxyflags: 1 strike- More than 5 user IDs per device ID: 1 strike
- More than 5 device IDs per user ID: 1 strike
Contact your customer success manager or fraud operations manager for access to risk scores, or to automatically block high-risk users.
Error handling
On errors or failed fraud checks, you may want to display a message to the end user. For example:- On
ERROR_PERMISSIONS: Unable to determine your location. Please make sure you’ve granted location permissions and try again. - On
ERROR_LOCATION: Unable to determine your location. Please make sure location services and wi-fi are enabled and try again. - On
ERROR_NETWORK: Unable to determine your location. Please make sure you’re connected to the Internet and try again. - On
country.allowed == falseorstate.allowed == false: Unable to verify your location. Please make sure you’re in an allowed area and try again. - On
fraud.proxy == true: Unable to verify your location. Please disconnect from any VPNs or proxy servers you may be using and try again. - On other error cases, or as a fallback: Unable to verify your location. Please contact support.