The player object
Inside PEERLESS, init() returns the current player:
const { player } = await Peerless.init();
// { playerId, playerName, gameId, guest, developerPlayerId }playerId is stable for this player in this game only. The same person has a different ID in another game, and no platform account ID, email or billing detail is ever shared with games.
Map to your own accounts
If your game has its own accounts, map the platform ID during initialization. Return an existing or newly linked ID from your backend:
const context = await Peerless.init({
mapPlayerIdentity: async (player) => {
const response = await fetch("/api/link-peerless", {
method: "POST",
body: JSON.stringify({ playerId: player.playerId }),
});
return (await response.json()).accountId;
},
});
console.log(context.player.developerPlayerId); // your account IDThe mapping changes nothing about the platform credential. Authenticate and store aliases on your server, and never merge players by display name or email.
Runtime credentials
Peerless.runtime() returns the current identity plus a short-lived token for your backend:
| Field | Meaning |
|---|---|
playerId · playerName · guest | Who is playing. |
gameId · buildId · grantId | What is being played, and the launch. |
mode · endpoint · endpoints | Networking mode and server addresses, when supplied. |
token · expiresAt | A short-lived credential. Request a fresh one instead of storing it. |
intent | The verified party launch, or null for a solo launch. |
Servers verify tokens with the provider helper. See Dedicated and managed servers.
Guests
Guests can play free games and join party invitations without creating an account. They receive a game-scoped player ID like everyone else. When a guest registers and verifies the same identity, their ID, scores and achievement progress continue. Signing in to a different, existing account switches identities and does not merge guest progress.
Guests have an empty friends list but can belong to a party. Paid games, chat, purchases and Creator studio require a verified account.