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, Phaser, LayaAir, etc.).
Integration
IntegrationAdd 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 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.
Available routes
https://bridge.playgama.com/v1/stable/playgama-bridge.jsrecommended
Contains the latest version for major v1.x.x. There will be no backward-incompatible changes.
https://bridge.playgama.com/latest/playgama-bridge.jsContains the latest version of the SDK. There may be backward-incompatible changes.
https://bridge.playgama.com/v1.25.0/playgama-bridge.jshttps://bridge.playgama.com/v1.26.0/playgama-bridge.jsetc.Contains the SDK of a specific version.
Config
ConfigDownload the playgama-bridge-config.json file from the GitHub release page, and add it to your project. There you can set up various identifiers and in-game purchases.
You can see an explanation of the file structure here: Playgama Bridge Config.
Initialization
InitializationBefore 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