checkAgeVerificationStatus
Description
This SDK function checks whether the user has completed legally required age verification. If not, it initiates a third-party identity verification flow to confirm eligibility before play.
Third-Party Integration
Recommended services:
- Persona – lightweight, fast integration
- Jumio
- Veriff
Drawn supports pluggable age verification providers via secure OAuth-style handoff and webhook confirmation.
Functions
getAgeStatus(userId: string): Promise<{ verified: boolean; verifiedAt?: string }>
triggerAgeVerification(userId: string): Promise<void>
verifyAgeIfNeeded(userId: string): Promise<boolean>
Behavior - Checks if user’s age verification has already been completed and cached (server-side, per wallet ID). - If not, calls out to the configured age verification provider. - Once complete, caches verification status and timestamp. - Blocks play until verified.
Response
{
"verified": true,
"verifiedAt": "2025-05-26T14:01:00Z"
}
Failure Case
{
"verified": false
}
UI Requirements - If age is not verified: - Prompt user with: “To play the lottery, please verify your age” - Launch verification provider flow (embedded iframe or redirect) - If verified: - Suppress all future prompts (valid for session or persistent)
Compliance Note All Drawn play orders must complete age verification prior to payment. Age verification must occur only once per user wallet unless legally required to refresh.