Age gate & compliance
Fail-closed age brackets, no DOB stored, verifiable parental consent, and per-feature gating.
A neutral age screen sets the player's bracket. A submitted birth year is mapped to a coarse bracket and DISCARDED — no date of birth is ever stored. Un-screened players are treated as the most-restrictive bracket (fail-closed).
await tg.compliance.setAge({ birthYear: 2013 });
const view = await tg.compliance.status(); // { bracket, consent_state, gated: {...} } Gating regulated features
The compliance view returns a gated map (feature → boolean). Use it to pre-disable UI, but the SERVER is the enforcement — every regulated surface (chat, loot boxes, IAP) checks the gate too. The developer sets which bracket each feature requires (dashboard → Moderation → Compliance).
Parental consent (VPC)
For a consent-eligible minor, request consent with a parent's email. The parent receives a signed link (their credential — never the child's) and Approves/Declines on a landing page. A grant unlocks the consent-gated features. The raw email is never stored (only a salted hash).
await tg.compliance.requestConsent('parent@example.com');