Setup

Integration steps

Use this order for a new integration:

  1. Install the Bridge package for your engine.

  2. Create or update playgama-bridge-config.json in the config editorarrow-up-right.

  3. Wait for Bridge initialization before calling SDK APIs.

  4. Read platform.language and apply localization.

  5. Load saved progress with storage.get(...).

  6. Send platform.sendMessage('game_ready') when the first playable frame is ready.

  7. Add interstitial ads at natural pauses, such as level transitions or game over.

JS Core contains the shared SDK logic. Engine packages for Unity, Godot, Construct and other engines are wrappers around JS Core. Use JS Core directly in web engines such as PlayCanvas, Phaser, LayaAir and similar frameworks.

Integration

Add the script from CDN:

<html>
    <head>
        <script src="https://bridge.playgama.com/v1/stable/playgama-bridge.js"></script>
    </head>
    <body>...</body>
</html>

When the game launches on a supported platform, Bridge automatically loads the required platform scripts. In unsupported environments, Bridge uses a mock platform and returns safe defaults (false, reject, etc.) instead of throwing.

Config

Use the config editorarrow-up-right to create or update playgama-bridge-config.json. This file stores SDK settings: platform identifiers, in-game purchases, ad placements, and more.

Initialization

Call the initialization method and wait for it to finish before using any bridge.* API.

bridge.initialize()
    .then(() => {
        // initialization was successful, SDK can be used
    })
    .catch(error => {
        // error, something went wrong
    })

Last updated