Setup

JS Core is the heart of the SDK, containing all the core logic. Plugins for game engines (Unity, Godot, Construct) are merely overlays on top of JS Core. JS Core can be used directly without any plugins in web engines (PlayCanvas, PixiJS, Phaser, etc.).

Integration

Download the playgama-bridge.js file from the GitHub release page, add it to your project, and include it in index.html:

<html>
    <head>
        <script src="./playgama-bridge.js"></script>
    </head>
    <body>...</body>
</html>

When the game is launched on supported platforms, the SDK will automatically load the necessary platform scripts. On unsupported platforms, no errors will occur; a mock platform will be used, and any request will return false, reject, etc.

Initialization

Before using the SDK, you need to call the initialization method and wait for it to complete.

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

Last updated