# Platform Parameters

At any time, you can retrieve values for specific parameters that you might use in your game, such as the user's browser language.

#### Platform ID

Identify the platform on which the game is currently running to customize features and settings accordingly.

```javascript
PlaygamaBridge.PlatformId
```

Returns the ID of the platform on which the game is currently running. Possible values are: `playgama`, `vk`, `ok`, `yandex`, `facebook`, `crazy_games`, `game_distribution`, `playdeck`, `telegram`, `y8`, `lagged`, `msn`, `microsoft_store`, `poki`, `qa_tool`, `discord`, `gamepush`, `bitquest`, `huawei`, `jio_games`, `reddit`, `youtube`, `mock`, `xiaomi`.

#### <img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2F9BooaofCI33U9Np5oeif%2FFrame%203%20(1).png?alt=media&#x26;token=0750b56a-a069-4759-bda9-29951f06cd30" alt="" data-size="line"> Platform Language

{% hint style="warning" %}
Check the language to display proper text labels.&#x20;
{% endhint %}

Get the language set by the user on the platform or the browser language if not provided by the platform, to localize game content.

```javascript
PlaygamaBridge.PlatformLanguage
```

If the platform provides user language data, this will be the language set by the user on the platform. If not, it will be the browser language.

Format: ISO 639-1. Example: `en`, `ru`

#### URL Parameter

Embed auxiliary information into the game URL to pass additional data or settings when launching the game.

```javascript
PlaygamaBridge.PlatformPayload
```

This parameter allows embedding auxiliary information into the game URL:

| Platform    | URL Format                                                |
| ----------- | --------------------------------------------------------- |
| VK          | vk.com/game\_i&#x64;**#your-info**                        |
| Yandex      | yandex.com/games/app/game\_i&#x64;**?payload=your-info**  |
| Crazy Games | crazygames.com/game/game\_nam&#x65;**?payload=your-info** |
| Mock        | site.com/game\_nam&#x65;**?payload=your-info**            |

#### Domain Information

Retrieve the top-level domain of the platform to handle domain-specific configurations and behavior.

```javascript
PlaygamaBridge.PlatformTld
```

Returns the top-level domain (TLD) of the platform. If there is no data – `null`. If the data is available – `com`, `ru`, etc.

#### Is Get All Games Supported

Verify whether the platform supports the <img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2F38oZ69YICUEDVIHYEOdt%2FScreenshot%202025-03-17%20at%2018.25.31.png?alt=media&#x26;token=36a2f948-0eaa-4993-8fc3-cd5bf6cec849" alt="" data-size="line"> action to retrieve the correct links to the developer's other games.

<figure><img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2FMfEhs5sZzJulkSy9lyah%2FScreenshot%202025-03-17%20at%2017.08.09.png?alt=media&#x26;token=91e7860b-e2b5-4c73-99cf-d6e6deecdadf" alt=""><figcaption></figcaption></figure>

#### Is Get Game By Id Supported

Verify whether the platform supports the <img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2FuiWE8YrzZznoafhoPayf%2FScreenshot%202025-03-17%20at%2018.26.10.png?alt=media&#x26;token=ebc20b91-8eb5-4ea1-8d97-39bf6f7dc38d" alt="" data-size="line"> action to retrieve the correct link to a specific game.

<figure><img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2FJ1eZLeQ7Ev7spctXnLW9%2FScreenshot%202025-03-17%20at%2017.09.40.png?alt=media&#x26;token=2d16768b-2076-4844-be14-bef72bd3d990" alt=""><figcaption></figcaption></figure>

#### Get All Games

This method retrieves the correct links to the developer's other games.

<figure><img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2F5N2wEdy3h1EnQmAzF7C0%2FScreenshot%202025-03-17%20at%2017.34.47.png?alt=media&#x26;token=64aa103f-1c82-4dcd-9854-f8bd01929d23" alt=""><figcaption></figcaption></figure>

<details>

<summary>Copy This Example</summary>

```json
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"on-clicked","objectClass":"Button"}],"actions":[{"id":"get-all-games","objectClass":"PlaygamaBridge"}]},{"eventType":"block","conditions":[{"id":"on-get-all-games-completed","objectClass":"PlaygamaBridge"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.PlatformAllGamesCount","comparison":4,"second-value":"0"}}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"for","objectClass":"System","parameters":{"name":"\"games\"","start-index":"0","end-index":"PlaygamaBridge.PlatformAllGamesCount - 1"}}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.PlatformId","comparison":0,"second-value":"\"yandex\""}}],"actions":[{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"AppID:\" & PlaygamaBridge.PlatformAllGamesPropertyValue(loopindex(\"games\"), \"appID\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Title:\" & PlaygamaBridge.PlatformAllGamesPropertyValue(loopindex(\"games\"), \"title\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"URL:\" & PlaygamaBridge.PlatformAllGamesPropertyValue(loopindex(\"games\"), \"url\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Cover URL:\" & PlaygamaBridge.PlatformAllGamesPropertyValue(loopindex(\"games\"), \"coverURL\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Icon URL:\" & PlaygamaBridge.PlatformAllGamesPropertyValue(loopindex(\"games\"), \"iconURL\")"}}]}]}]}]}]}
```

</details>

#### Get Game By Id

This method retrieves the correct link to a specific game from the developer.

<figure><img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2FhZkodUtq1RaKHM9VukHI%2FScreenshot%202025-03-17%20at%2017.39.45.png?alt=media&#x26;token=a629ac7c-189f-4add-8a99-66165daf9214" alt=""><figcaption></figcaption></figure>

<details>

<summary>Copy This Example</summary>

```json
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"on-clicked","objectClass":"Button"}],"actions":[{"id":"add-action-parameter","objectClass":"PlaygamaBridge","parameters":{"key":"\"gameId\"","value":"\"111111\""}},{"id":"get-game-by-id","objectClass":"PlaygamaBridge"}]},{"eventType":"block","conditions":[{"id":"on-get-game-by-id-completed","objectClass":"PlaygamaBridge"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"is-last-action-completed-successfully","objectClass":"PlaygamaBridge"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.PlatformId","comparison":0,"second-value":"\"yandex\""}}],"actions":[{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"AppID:\" & PlaygamaBridge.PlatformGameByIdPropertyValue(\"appID\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Title:\" & PlaygamaBridge.PlatformGameByIdPropertyValue( \"title\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"URL:\" & PlaygamaBridge.PlatformGameByIdPropertyValue(\"url\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Cover URL:\" & PlaygamaBridge.PlatformGameByIdPropertyValue(\"coverURL\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Icon URL:\" & PlaygamaBridge.PlatformGameByIdPropertyValue(\"iconURL\")"}},{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"\"Is Available:\" & PlaygamaBridge.PlatformGameByIdPropertyValue(\"isAvailable\")"}}]}]}]}]}
```

</details>

#### <img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2F9BooaofCI33U9Np5oeif%2FFrame%203%20(1).png?alt=media&#x26;token=0750b56a-a069-4759-bda9-29951f06cd30" alt="" data-size="line"> Sending a Message to the Platform

{% hint style="danger" %}
The call to <mark style="color:purple;">SendMessage</mark> with the parameter <mark style="color:orange;">GameReady</mark> is mandatory!

Don't forget to implement it. Send this message only when the game is fully loaded.
{% endhint %}

Send predefined messages to the platform to trigger specific actions or events, such as signaling that the game is ready.

<figure><img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2FaRPOtu7HgqzPrbr10GQD%2FScreenshot%202024-10-17%20at%205.11.01%E2%80%AFPM.png?alt=media&#x26;token=213b7eb9-b554-45a0-914c-abc3c08a1cee" alt=""><figcaption></figcaption></figure>

| Message                 | Parameters                                     | Description                                                                                    |
| ----------------------- | ---------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Game Ready              | No parameters                                  | The game has loaded, all loading screens are passed, the player can interact with the game.    |
| In-Game Loading Started | No parameters                                  | Any loading inside the game has started. For example, when a level is loading.                 |
| In-Game Loading Stopped | No parameters                                  | In-game loading has finished.                                                                  |
| Player Got Achievement  | No parameters                                  | The player reached a significant moment. For example, defeating a boss, setting a record, etc. |
| Level Started           | <p>Optional. "world" <br>Optional. "level"</p> | Gameplay has started. For example, the player has entered a level from the main menu.          |
| Level Completed         | <p>Optional. "world" <br>Optional. "level"</p> | Gameplay has completed. For example, the player won level.                                     |
| Level Failed            | <p>Optional. "world" <br>Optional. "level"</p> | Gameplay has failed. For example, the player lost level.                                       |
| Level Paused            | <p>Optional. "world" <br>Optional. "level"</p> | Gameplay has paused. Opened settings menu or used pause button                                 |
| Level Resumed           | <p>Optional. "world" <br>Optional. "level"</p> | Gameplay has resumed. Returned from settings menu or hit unpause button                        |

#### Is Audio Enabled

Check if the audio is turned on on the platform.

<figure><img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2FwCpKJxNy3hNRYP0nUxER%2FScreenshot%202025-07-25%20at%2010.01.40%E2%80%AFAM.png?alt=media&#x26;token=fc25c053-06a5-42a2-8bb0-fd481755d22f" alt=""><figcaption></figcaption></figure>

#### Pause

<figure><img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2FbO6JddkhzqpcdyOR8KfO%2FScreenshot%202025-07-25%20at%2010.01.15%E2%80%AFAM.png?alt=media&#x26;token=83ddeb77-842c-4ceb-be8c-38d9ea7948eb" alt=""><figcaption></figcaption></figure>

#### Server Time

<figure><img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2FmPxbx0ZgyAobtoDdDvlp%2FScreenshot%202024-10-17%20at%205.14.31%E2%80%AFPM.png?alt=media&#x26;token=f6f36f10-6cad-46e8-9666-2129fb6c7799" alt=""><figcaption></figcaption></figure>

<details>

<summary>Copy This Example</summary>

```
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"on-clicked","objectClass":"Button"}],"actions":[{"id":"get-server-time","objectClass":"PlaygamaBridge"}]},{"eventType":"block","conditions":[{"id":"on-get-server-time-completed","objectClass":"PlaygamaBridge"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"has-server-time","objectClass":"PlaygamaBridge"}],"actions":[{"id":"log","objectClass":"Browser","parameters":{"type":"log","message":"PlaygamaBridge.ServerTime"}}]}]}]}
```

</details>

#### Current Visibility State

Check if the game tab is visible or hidden, and adjust game behavior accordingly, such as muting sound when hidden.

```javascript
PlaygamaBridge.VisibilityState
```

Returns the current visibility state of the game (the tab with the game). Possible values: `visible`, `hidden`.

{% hint style="info" %}
React to changes in visibility state. For example, mute the game sound when `hidden` and unmute when `visible`.
{% endhint %}

<figure><img src="https://1088849411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5ukgSPDBOdbQp4FYtbz1%2Fuploads%2F5eGNJYcAchSFkMxgzeqP%2FScreenshot%202024-10-17%20at%206.15.49%E2%80%AFPM.png?alt=media&#x26;token=11a3e893-707a-4b72-9368-2cd6877e6f9f" alt=""><figcaption></figcaption></figure>

<details>

<summary>Copy This Example</summary>

```
{"is-c3-clipboard-data":true,"type":"events","items":[{"eventType":"block","conditions":[{"id":"on-visibility-state-changed","objectClass":"PlaygamaBridge"}],"actions":[],"children":[{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.VisibilityState","comparison":0,"second-value":"\"visible\""}}],"actions":[{"type":"comment","text":"visible"}]},{"eventType":"block","conditions":[{"id":"compare-two-values","objectClass":"System","parameters":{"first-value":"PlaygamaBridge.VisibilityState","comparison":0,"second-value":"\"hidden\""}}],"actions":[{"type":"comment","text":"hidden"}]}]}]}
```

</details>
