Skip to main content

Player

Read the player's non-sensitive public profile to personalise your game.

const player = await gamma.getPlayer();
if (player) {
greet(player.displayName); // "Welcome back, Alex!"
}

Type:

interface Player {
id: string;
displayName: string;
avatar: string | null;
frame: string | null;
isSubscribed: boolean;
}

Returns null when unavailable (e.g. outside the app, or no authenticated user).

Privacy: getPlayer never returns email, phone, coin balance, or any other sensitive field. Use it only for personalisation. For the balance, call getCoins.

Ask:View .md