Skip to content

checkGeoEligibility

Description
This SDK function determines whether a user is currently located in a legally authorized state for lottery play. It uses browser geolocation and cross-references backend-configured eligibility rules per game.

Request
No parameters required. Invoked from within shouldShowPlayOption.

Behavior - Attempts to retrieve the user's current location via navigator.geolocation. - Sends coordinates to the Drawn API for resolution to a U.S. state. - Returns list of eligible games for the state, if any.

Response ```json { "eligible": true, "state": "MI", "availableGames": ["Powerball", "Mega Millions"] }

Error Cases - PERMISSION_DENIED: User declined geolocation access. - POSITION_UNAVAILABLE: Unable to determine location (e.g., no GPS). - NOT_ELIGIBLE: User is outside supported states.

Sample Error Output ```json { "eligible": false, "reason": "PERMISSION_DENIED" }