Use the hosted panels
The PEERLESS player already has party, friends, chat and profile panels. Open them from your own buttons instead of rebuilding those flows:
const context = await Peerless.init();
if (context.capabilities.socialUI) {
partyButton.onclick = () => Peerless.ui.open("party");
friendsButton.onclick = () => Peerless.ui.open("friends");
chatButton.onclick = () => Peerless.ui.open("chat");
profileButton.onclick = () => Peerless.ui.open("profile");
}ui.open() accepts menu, party, friends, chat, profile, settings, achievements and leaderboards. It resolves to true when the panel opens and false in standalone mode or when the overlay is off. Multiplayer keeps running while a panel is open; see overlay events to pause input.
Draw your own party frames
social.onChange() delivers a snapshot right away and then whenever it changes, polling every five seconds while subscribed:
const context = await Peerless.init();
let stopSocial, stopErrors;
if (context.capabilities.social) {
stopErrors = Peerless.on("social-error", (error) => showSocialError(error.message));
stopSocial = Peerless.social.onChange(({ me, friends, party }) => {
renderPlayerCard(me);
renderFriends(friends);
renderPartyFrames(party?.members ?? []);
});
}
// On scene shutdown:
stopSocial?.();
stopErrors?.();A failed refresh emits social-error and keeps the last good snapshot, so frames never flicker away during a network hiccup.
One-shot reads
| Method | Result |
|---|---|
social.snapshot() | { me, friends, party } |
social.me() | The current player's card, including guest. |
social.friends() | Accepted friends with presence, activity and statusText. |
social.party() | The current party, or null when solo. |
social.profile(playerId) | A card for yourself, a friend or a party member. Other IDs are rejected. |
Data you receive
- Player card:
playerId,playerName,avatarUrl,avatarFrame,nameStyle,membershipBadgeandprofileUrl. - Friend: a card plus
presence(online,looking_for_party,away,busyoroffline). Invisible friends appear offline; ignored players are excluded both ways. - Party:
id,leaderId,selectedGameIdand members withready.
IDs match the game-scoped IDs in runtime credentials and session rosters. Email, credentials, billing and account settings are never included.