What the SDK is
peerless-sdk.js is a dependency-free browser script (SDK 2.5, protocol 2). Load it before your game and it defines window.Peerless. Inside the PEERLESS player it talks to the parent page; everywhere else init() selects standalone mode and makes no request, so the same build can ship to several stores.
The SDK is optional. A single-player game can be uploaded without it, and player volume, mute and fullscreen still work.
Downloads
| File | Purpose |
|---|---|
| peerless-sdk.js | The browser SDK. Bundle it with your build. |
| peerless-sdk.d.ts | TypeScript declarations with documentation comments. |
| peerless-colyseus.js | Binds an existing Colyseus lobby to PEERLESS sessions. |
| Managed Node kit | Server helpers, packager, doctor and contract tests. |
API at a glance
| API | Purpose |
|---|---|
init() · ready() · runtime() | Select the mode, read identity, capabilities and launch credentials. |
ui.open(panel) | Open party, friends, chat, profile, settings, menu, achievements or leaderboards. |
social.* | Player cards, accepted friends, presence and the current party; change subscriptions. |
analytics.* | Report gameplay readiness and completed rounds. |
achievements.* | List achievements, unlock them and report cumulative progress. |
leaderboards.* | Submit scores and read global, friends or nearby boards. |
audio.* | Read and follow the player's volume and mute setting. |
sessions.* | Bind lobbies, queue, cancel, reconnect, listen hosting and regional connections. |
join() · send() · leave() | Relay rooms for small games without a backend. |
managed() | Refresh short-lived credentials for managed and dedicated servers. |
player.* · fullscreen() · asset() | Overlay roster, fullscreen requests and export-relative assets. |
on(type, listener) | Subscribe to SDK events; returns an unsubscribe function. |
See the function reference for signatures, and events for every event type.
Versions
| SDK | Highlights |
|---|---|
| 2.5 | audio.state() and audio.onChange(); typed capabilities and events. |
| 2.4 | Listen (WebRTC) hosting with TURN fallback and host migration hooks. |
| 2.2 | Player cards, friends, presence, parties and hosted social panels. |
| 2.1 | Guest identity, gameplay analytics and leaderboards. |
All versions speak protocol 2 and remain supported by the player.