For the complete documentation index, see llms.txt. This page is also available as Markdown.

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.type
Type
Game logic

not_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.

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.

Last updated