Skip to main content
Geo-compliance verifies that a user is in a location where your product is allowed, and that the location can be trusted. By the end of this quickstart, your app will run one verified location check, your backend will verify the returned geolocation token and read passed, and you will have seen both a passed and a failed check.
Fraud detection and verified location checks are available on the Enterprise plan.

Quickstart

Before you start:
  • Enable Fraud for your project: under Fraud on the Settings page of the Radar dashboard, select Yes for Enabled. In the same section, allow the state you are testing from in the country and state lists. An empty list allows every country or state.
  • Install the Radar SDK and the fraud plugin for your platform. See Fraud plugin setup. The Mac and Windows SDKs are available on request.
  • Get a Test publishable key for your app, and your project’s JWT secret key for your backend. The JWT secret key is shown in the same Fraud section. See Choose the right API key.
The client initializes the SDK, sets the signed-in user, requests location permission, runs one check, and sends the token to your backend:
The backend verifies the token and reads passed:
Your backend decides, not your app. The passed value on the client is for your UI. For every validation step, see Validate a token.

See a passed and a failed result

Sign in as user-123 from an allowed state and trigger the action. After signature verification, the payload includes these fields, and your backend performs the action:
To see a failed result without changing location, create a rule on the Block rules page in the dashboard that blocks the user ID user-123, then trigger the action again. The request succeeds, the token carries a failed result, and your backend rejects the action:
Remove the block rule when you finish. See Force a pass or a fail, and for the full payload, Geolocation token schema.

Understand check results

A check produces four separate facts. They aren’t interchangeable:
  • The request succeeded: The client returned a success status and a token. The token can still carry passed set to false.
  • The token is authentic: Your backend verified the signature and expiry with your JWT secret key. That doesn’t say the token belongs to this user, product, or action.
  • The location was verified: passed is true in the verified payload, so the jurisdiction and fraud checks passed.
  • The user is eligible: The token is authentic, belongs to the signed-in user and the intended product, hasn’t expired, and has passed set to true.
Perform a protected action only when the last statement holds.

Next steps

For products, when to run checks, the companion app, and desktop apps, see Verify location for compliance. To assess device and network risk without a location requirement, start with Fraud overview and quickstart instead.

See also