Leaderboards
You are reading the documentation for Bridge SDK v2. If you need the obsolete v1 documentation, see Documentation (v1).
Leaderboards rank players by score. Bridge wraps native platform leaderboards and provides an in-game data API when the platform does not render a leaderboard UI. Implement it if your game has comparable scores.
Leaderboards Type
Returns the leaderboard mode for the current platform. Use it to decide which leaderboard UI to show or hide.
bridge.leaderboards.typeBridge.leaderboards.typeRead the mode with the PlaygamaBridge.LeaderboardsType expression, or branch with the Is Leaderboards Type = Not Available / In Game / Native / Native Popup conditions.
Read the mode with the PlaygamaBridge::LeaderboardsType() expression, or branch with the The leaderboard is of type Not Available / In Game / Native / Native Popup conditions.
Bridge.leaderboards.typeplaygama_bridge_leaderboards_type()bridge.leaderboards.typebridge.leaderboards.typenot_available
Hide leaderboard UI.
in_game
Call setScore(...) and render your own leaderboard with getEntries(...).
native
Call setScore(...) only. The platform renders the leaderboard, and getEntries(...) is unavailable.
native_popup
Call setScore(...) and open the native overlay with showNativePopup(...). getEntries(...) is unavailable.
Platform support · 8 of 26 platforms
in_game supports: y8, yandex
native supports: gamesnacks, jio_games, lagged, msn, youtube
native_popup supports: facebook
Does not support: crazy_games, discord, dlightek, game_distribution, gamepush, huawei, microsoft_store, ok, playdeck, playgama, poki, portal, reddit, samsung, telegram, tiktok, vk, xiaomi
On top of the platform types, SaaS leaderboards can be enabled per platform via the saas config block — the module then works as in_game through the Playgama backend.
Setup
Configure leaderboards in the config. Add an id for each leaderboard and use that ID in game code. If a platform uses a different native ID, map it under that platform key.
{
...
"leaderboards": [
{
"id": "test_leaderboard", // use this id in game logic
"isMain": true, // optional: marks the game's main leaderboard
"<ANY_PLATFORM_ID_HERE>": "<OVERRIDED_ID_FOR_PLATFORM_HERE>"
}
]
}isMain matters on platforms with a single primary leaderboard (jio_games, youtube): only the score of the leaderboard marked isMain: true is submitted there.
Set Score
Submit the player's score after a meaningful result, such as level completion or game over. Avoid submitting temporary or per-frame values.
Get Entries
Works only when bridge.leaderboards.type = in_game
Load leaderboard entries when leaderboards.type is in_game and render them in your own UI.
In the event sheet:
On a trigger (e.g. System → On start of layout), add the Get Leaderboard Entries action (parameter: ID).
Add the On Leaderboards Get Entries Completed condition. Inside it, when Is Last Action Completed Successfully, loop with System → For from
0toPlaygamaBridge.LeaderboardEntriesCount - 1and readLeaderboardEntryId,LeaderboardEntryName,LeaderboardEntryPhoto,LeaderboardEntryRank,LeaderboardEntryScoreatloopindex.
In the events sheet:
On a trigger (e.g. At the beginning of the scene), add the Leaderboards Get Entries action (parameter: Id).
Add the On Leaderboards Get Entries Completed condition. Inside it, when Is Last Action Completed Successfully, Repeat
PlaygamaBridge::LeaderboardEntriesCount()times and readLeaderboardEntryId,LeaderboardEntryName,LeaderboardEntryPhoto,LeaderboardEntryRank,LeaderboardEntryScoreat the current index.
Show Native Popup
Works only when bridge.leaderboards.type = native_popup
Opens the platform's native leaderboard overlay. Use it only when leaderboards.type is native_popup.
In the event sheet:
On a trigger (e.g. System → On start of layout), add the Show Leaderboard Native Popup action (parameter: ID).
Add the On Leaderboards Show Native Popup Completed condition. Inside it, check Is Last Action Completed Successfully (with a System → Else branch for errors).
Last updated