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

Setup

Installation

Install the Bridge package for your engine:

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

CDN (recommended)

Add the script from CDN:

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

npm

npm i @playgama/bridge
import bridge from '@playgama/bridge'

The SDK loads as a separate playgama-bridge.js file, and the import returns that same window.bridge instance with full typings. With Vite, add the plugin to vite.config.js. It adds the script tag and copies the file into the build:

import playgamaBridge from '@playgama/bridge/vite'

export default {
    base: './',
    plugins: [playgamaBridge()],
}

With other bundlers, add the CDN script from the option above to index.html before your game script. For a self-contained build, use playgamaBridge({ mode: 'local' }), or copy node_modules/@playgama/bridge/dist/playgama-bridge.js next to index.html and load it with <script src="playgama-bridge.js"></script>.

For TypeScript projects:

With both options, place playgama-bridge-config.json next to your index.html — Bridge loads it from ./playgama-bridge-config.json.

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.

Initialization

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

Installation

  • Open Window → Package Management → Package Manager

  • Click the plus button and select Install package from git URL

  • Enter https://github.com/playgama/bridge-unity.git

  • Open Playgama → Bridge Setup and click Add in the Add Bridge WebGL Template section

Initialization and Build

The Unity package initializes Bridge automatically while the game loads. No extra initialization call is required.

Select the Bridge WebGL Template before building.

Installation

Download the latest version of playgama_bridge.c3addon from the GitHub release page.

Go to Menu → View → Addon Manager and click Install new addon.... Select the downloaded file and click Install in the popup window.

Open your project, right-click on the Object types folder, and select Add new object type. Choose Playgama Bridge and click Insert.

Setup

Set Use Worker to No in the project settings (Menu → Project → Properties).

Installation

Release page

Download the required version of PlaygamaBridge.json from the GitHub release page.

Go to Project Manager → Create or search for new extensions → Import extension and select the downloaded file.

Initialization

Initialization starts automatically. Wait until it completes before running game logic that uses Bridge, such as reading player profile or storage data. Use the Is Initialized condition to gate that logic.

Integration

Download the latest playgama_bridge.zip archive, unzip it, and place the contents into res://addons:

Enable the plugin in the project settings:

Initialization

The Godot plugin initializes Bridge automatically while the game loads. No extra initialization call is required.

Build

Select the Bridge HTML template in export settings under Custom HTML Shell:

Installation

Download the latest .yymps from the GitHub release page and import it via Tools → Import Local Package menu.

Tools → Import Local Package

Initialization and Build

The GameMaker package initializes Bridge automatically while the game loads. No extra initialization call is required.

Select the Bridge index template before building.

Game Options → HTML5 → General

Installation

Copy the Source code.zip link from the GitHub release page and add it as a dependency in your project settings.

Then select Project → Fetch Libraries.

Initialization and Build

The Defold package initializes Bridge automatically while the game loads. No extra initialization call is required.

Select the Bridge index template before building.

Installation

npm (recommended)

Install the package in the project root — the folder that contains assets/:

Import the SDK and initialize it before using any API:

Add the SDK script to the web-mobile build template, build-templates/web-mobile/index.ejs, inside <head> before any game script:

Put playgama-bridge-config.json into build-templates/web-mobile/ — Cocos Creator copies that folder into the build output, so the file ends up next to index.html, where Bridge looks for it.

Editor extension

Download the latest .zip archive from the GitHub release page and import it into your project. Import all files except the optional Examples folder. The extension installs web-mobile and preview templates automatically; you can also run manual installation from Extensions → Playgama Bridge → Install.

The templates load the SDK from CDN, set bridge.engine, and call bridge.initialize() before the game starts, so no initialization call is needed in your code. The npm package can still be added for TypeScript typings: it carries no copy of the SDK and returns the instance the templates load. Skip its script-tag step — the templates already add the SDK.

Build Template

Integration

Download PlaygamaBridge.js from the GitHub release page. In TurboWarp, click Add Extension, select Custom Extension, choose the downloaded file, and enable Run without sandbox.

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.

Initialization

Call the initialization method and wait for it to finish before using Bridge blocks.

Required steps

Installation is only the first part of the integration. Every game must also implement the required steps. See the full list with exact methods in API → Required steps.

Last updated