Verifiable RNG
Deterministic, server-seeded randomness so loot and crit rolls can't be client-forged.
tg.rng gives a deterministic seed for a named stream and time period. The same (player, stream, period) always yields the same seed, derived from a server secret — so a client can't reroll a loot drop by replaying the request, and you can reproduce a roll for support/anti-cheat.
const { seed } = await tg.rng.seed('loot');
// derive your rolls deterministically from `seed` Server-side by default
The high-stakes rolls (loot boxes, gacha) already happen server-side via the economy — tg.rng is for client-side effects you want verifiable and consistent. A player-scoped seed is per-player; a shared-scope seed is the same for everyone (e.g. a daily map).