---
metadata:
  - name: generator
    content: Diplodoc Platform v5.54.4
alternate:
  - https://yandex.com/dev/games/doc/en/requirements/1/19.md
  - https://yandex.com/dev/games/doc/hi/requirements/1/19.md
  - https://yandex.com/dev/games/doc/ko/requirements/1/19.md
  - https://yandex.com/dev/games/doc/ru/requirements/1/19.md
  - https://yandex.com/dev/games/doc/tr/requirements/1/19.md
  - https://yandex.com/dev/games/doc/vi/requirements/1/19.md
  - https://yandex.com/dev/games/doc/zh/requirements/1/19.md
  - href: en/requirements/1/19.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/games/doc/en/llms.txt

# SDK methods

<!-- source: en/_includes/script-common.md -->
<!-- source: en/_includes/script/index-js.md -->

<!-- endsource: en/_includes/script/index-js.md -->

<!-- source: en/_includes/script/requirements-js.md -->

<!-- endsource: en/_includes/script/requirements-js.md -->

<!-- source: en/_includes/script/image-modal-js.md -->

<!-- endsource: en/_includes/script/image-modal-js.md -->
<!-- endsource: en/_includes/script-common.md -->

{% note info "Item 1.19 of the Game Requirements" %}

The initialization of the Yandex Games SDK and the use of its methods are carried out in strict accordance with the documentation and game requirements:

1. The SDK is initialized exactly as described on the [Connection and usage](https://yandex.com/dev/games/doc/en/sdk/sdk-about.md) page.

1. At the moment when the user can start playing the game, the `LoadingAPI.ready()` method from `Game Ready` must be called.

1. The use of gameplay markup is optional; however, if the `GameplayAPI.start()` and `GameplayAPI.stop()` methods are used in the game, the timing of event dispatches must strictly correspond to those described in section [Gameplay](https://yandex.com/dev/games/doc/en/sdk/sdk-game-events.md#gameplay).

1. Tracking `game_api_pause` and `game_api_resume` events is optional. However, if `ysdk.on()` and `ysdk.off()` methods are used in the game, the event handling logic must strictly follow the description in section [Pause and Resume Events](https://yandex.com/dev/games/doc/en/sdk/sdk-events.md#pause-resume).

{% endnote %}



## SDK Initialization {#sdk-initializing}

**1.19.1.** The SDK is initialized exactly as specified on the [Connection and usage](https://yandex.com/dev/games/doc/en/sdk/sdk-about.md) page. For the requirement to be considered fulfilled, the current loader must be used.

### Loader Version Check {#loader-check}

1. Start the game with the debug panel.

   <!-- source: en/_includes/requirements/start-debug-panel.md -->
   {% list tabs %}

   - Using the developer console
       1. Open the [Yandex Games console](https://games.yandex.com/console){.external}.
       2. Select the game you need.
       3. In the top left corner, click on **Open with debug panel**.

   - Using the address bar
       1. Open the required game.
       2. Add `&debug-mode=16` to the end of the browser's address bar.

          Example link: `https://yandex.com/games/app/XXXX?debug-mode=16`, where `XXXX` is the unique game ID.

   {% endlist %}
   <!-- endsource: en/_includes/requirements/start-debug-panel.md -->

1. On the debug panel to the left of the Game Ready indicator, find two letters:

    - `IF` (init false) — the game supports the old loader. Hovering over `IF` will display _Is loader: false_.

    - `IT` (init true) — the game supports the new loader. Hovering over `IT` will display _Is loader: true_.

### Examples {#examples-loader}

<div class="table-50">

#|
|| **Loader** | **Comment** ||
|| ![Game screenshot: the debug panel shows IF, and the tooltip below reads: "SDK was initialized Version: v2. Is loader: false."](../../_images/requirements/1-19-sdk-methods/gra/old-1.webp) | Old loader. Displayed on the debug panel `IF`. ||
|| ![Game screenshot: the debug panel shows IF, and the tooltip below reads: "SDK was initialized Version: v2. Is loader: false."](../../_images/requirements/1-19-sdk-methods/gra/old-2.webp) | Old loader. Displayed on the debug panel `IF`. ||
|| ![Game screenshot: the debug panel shows IT, and the tooltip below reads: "SDK was initialized Version: v2. Is loader: true."](../../_images/requirements/1-19-sdk-methods/gra/new-1.webp) | New loader. Displayed on the debug panel `IT`. ||
|| ![Game screenshot: the debug panel shows IT, and the tooltip below reads: "SDK was initialized Version: v2. Is loader: true."](../../_images/requirements/1-19-sdk-methods/gra/new-2.webp) | New loader. Displayed on the debug panel `IT`. ||
|#

</div>



## Game Ready {#gameready}

**1.19.2.** When the user is ready to start the game, call the `LoadingAPI.ready()` method from [Game Ready](https://yandex.com/dev/games/doc/en/sdk/sdk-game-events.md#gameready).

To fulfill the requirement, the `LoadingAPI.ready()` method must be called at the [correct moment](#gameready-correct).

### Loading screen {#loading-screen}

During the game's loading, the Yandex Games platform first shows its own loading screen — a pulsing game icon with the "Loading" caption. It can be dismissed manually by tapping the screen.

{% cut "What the Yandex Games loading screen looks like" %}

![Yandex Games loading screen: a pulsing game icon with the "Loading" caption](../../_images/requirements/1-19-sdk-methods/gra/yandex-games-loading.webp)

{% endcut %}

Moderation checks the game's own loading screen. If it contains prohibited content — third-party links, unauthorized logos, elements that infringe copyright — this will be grounds for rejection.

### Preparation {#gameready-preparation}

1. Start the game with the debug panel.

   <!-- source: en/_includes/requirements/start-debug-panel.md -->
   {% list tabs %}

   - Using the developer console
       1. Open the [Yandex Games console](https://games.yandex.com/console){.external}.
       2. Select the game you need.
       3. In the top left corner, click on **Open with debug panel**.

   - Using the address bar
       1. Open the required game.
       2. Add `&debug-mode=16` to the end of the browser's address bar.

          Example link: `https://yandex.com/games/app/XXXX?debug-mode=16`, where `XXXX` is the unique game ID.

   {% endlist %}
   <!-- endsource: en/_includes/requirements/start-debug-panel.md -->

1. On the debug panel, find the Game Ready indicator ![SVG](../../_images/debug-panel/gra-purple.svg).

### Game Ready check logic {#gameready-check}

1. Verify that the purple indicator ![SVG](../../_images/debug-panel/gra-purple.svg) changes to green ![SVG](../../_images/debug-panel/gra-green.svg) within 90 seconds.
1. Reload the game.
1. Recheck at what moment the indicator changes color.

Scenarios that moderation considers during the check:

<div class="table-50">

#|
|| **Scenario** | **Example** ||
|| The Yandex Games loading screen is dismissed manually — tap the screen to dismiss it, then check when the indicator changes. | ![Game loading video: the Yandex Games loading screen is dismissed by tapping, then the game's own loading screen is shown, after which the game becomes available for interaction.](../../_images/requirements/1-19-sdk-methods/gra/without-yandex-games-loading.gif) ||
|| The Yandex Games loading screen disappears automatically — wait for the screen to hide itself, then check when the indicator changes. | ![Game loading video: the Yandex Games loading screen disappears automatically, then the game's own loading screen is briefly shown, after which the game becomes available for interaction.](../../_images/requirements/1-19-sdk-methods/gra/with-yandex-games-loading.gif) ||
|#

</div>

{% note info %}

Game Ready must work correctly in both scenarios. If the `LoadingAPI.ready()` call is tied to a specific point in time rather than the game's actual readiness, this will be noticeable when the Yandex Games loading screen is manually dismissed, and moderation will flag this as a violation.

{% endnote %}

### Game Ready works correctly {#gameready-correct}

The purple indicator ![SVG](../../_images/debug-panel/gra-purple.svg) changes to green ![SVG](../../_images/debug-panel/gra-green.svg) at the moment:

- when the menu is available;
- when the game is playable (including the initial animation).

<div class="table-50">

#|
|| **Game Ready** | **Comment** ||
|| ![Game loading video: the debug panel indicator blinks blue during loading; when the menu appears, the indicator turns green.](../../_images/requirements/1-19-sdk-methods/gra/menu-1.gif) | The green indicator appears at the moment when the menu becomes available. ||
|| ![Game loading video: the debug panel indicator blinks blue during loading; when the menu appears, the indicator turns green.](../../_images/requirements/1-19-sdk-methods/gra/menu-2.gif) | The green indicator appears at the moment when the menu becomes available. ||
|| ![Game loading video: the debug panel indicator blinks blue during loading; when the menu appears, the indicator turns green.](../../_images/requirements/1-19-sdk-methods/gra/menu-3.gif) | The green indicator appears at the moment when the menu becomes available. ||
|| ![Game loading video: the debug panel indicator blinks blue during loading; when the game becomes available for interaction, the indicator turns green.](../../_images/requirements/1-19-sdk-methods/gra/game-ok-1.gif) | The green indicator appears at the moment when the game is available for interaction. ||
|| ![Game loading video: the debug panel indicator blinks blue during loading; when the game becomes available for interaction, the indicator turns green.](../../_images/requirements/1-19-sdk-methods/gra/game-ok-2.gif) | The green indicator appears at the moment when the game is available for interaction. ||
|| ![Game loading video: the debug panel indicator blinks blue during loading; when the game becomes available for interaction, the indicator turns green.](../../_images/requirements/1-19-sdk-methods/gra/game-ok-3.gif) | The green indicator appears at the moment when the game is available for interaction. ||
|#

</div>

### Game Ready is not working correctly {#gameready-incorrect}

The purple indicator ![SVG](../../_images/debug-panel/gra-purple.svg) changed to green ![SVG](../../_images/debug-panel/gra-green.svg):

- before the game became available for interaction (there are progress bars, spinners, black screen, etc.);
- a few seconds after the game became available for interaction.

<div class="table-50">

#|
|| **Game Ready** | **Comment** ||
|| ![Game loading video: during loading, the debug panel indicator is green even though the game cannot yet be interacted with.](../../_images/requirements/1-19-sdk-methods/gra/before-game-1.gif) | The green indicator appears before the game becomes available for interaction. ||
|| ![Game loading video: during loading, the debug panel indicator first blinks blue, then turns green even though the game cannot yet be interacted with.](../../_images/requirements/1-19-sdk-methods/gra/before-game-2.gif) | The green indicator appears before the game becomes available for interaction. ||
|| ![Game loading video: during loading and the ad, the debug panel indicator is green even though the game cannot yet be interacted with.](../../_images/requirements/1-19-sdk-methods/gra/before-game-3.gif) | The green indicator appears before the game becomes available for interaction. ||
|| ![Gameplay video: the game is already available for interaction, but the debug panel indicator continues to blink blue for a few more seconds.](../../_images/requirements/1-19-sdk-methods/gra/after-start-1.gif) | The green indicator appeared only a few seconds after the game became available for interaction. ||
|| ![Gameplay video: the game is already available for interaction, but the debug panel indicator continues to blink blue for a few more seconds.](../../_images/requirements/1-19-sdk-methods/gra/after-start-2.gif) | The green indicator appeared only a few seconds after the game became available for interaction. ||
|#

</div>

### Game Ready is not integrated {#no-gameready}

The indicator turned red ![SVG](../../_images/debug-panel/gra-red.svg) after 90 seconds.

<div class="table-50">

#|
|| **Game Ready** | **Comment** ||
|| ![Quiz game video: while the game is in progress, the debug panel indicator blinks blue, then turns red.](../../_images/requirements/1-19-sdk-methods/gra/no-gra-1.gif) | The indicator turned red — Game Ready is not integrated. ||
|#

</div>

## Gameplay Markup {#gameplay}

**1.19.3.** The methods `GameplayAPI.start()` and `GameplayAPI.stop()` allow marking the start and stop of the gameplay. If they are used in the game, then the moments of event sending strictly correspond to the descriptions in the section [Gameplay](https://yandex.com/dev/games/doc/en/sdk/sdk-game-events.md#gameplay).

### Preparation {#gameplay-preparation}

1. Start the game with the [debug panel](https://yandex.com/dev/games/doc/en/console/debug-panel.md).

   <!-- source: en/_includes/requirements/start-debug-panel.md -->
   {% list tabs %}

   - Using the developer console
       1. Open the [Yandex Games console](https://games.yandex.com/console){.external}.
       2. Select the game you need.
       3. In the top left corner, click on **Open with debug panel**.

   - Using the address bar
       1. Open the required game.
       2. Add `&debug-mode=16` to the end of the browser's address bar.

          Example link: `https://yandex.com/games/app/XXXX?debug-mode=16`, where `XXXX` is the unique game ID.

   {% endlist %}
   <!-- endsource: en/_includes/requirements/start-debug-panel.md -->

2. On the debug panel, find the gamepad button 🎮.

### Checking gameplay markup {#gameplay-check-principle}

Track the status of the gameplay indicator depending on actions:

   - When a player starts the gameplay or resumes it after a pause, the method `GameplayAPI.start()` must be called. The gameplay indicator should turn green ![SVG](../../_images/debug-panel/gameplay-on.svg) — gameplay is in progress.

   - When a player finishes the gameplay or pauses it, the method `GameplayAPI.stop()` must be called. The gameplay indicator should turn red ![SVG](../../_images/debug-panel/gameplay-off.svg) — gameplay is paused.

Scenarios that moderation considers during the check:

- Starting and finishing a level.
- Opening and closing the game menu.
- Opening and closing the purchase menu.
- Starting and closing advertisements.
- Losing focus on the game and returning to it (switching to another browser tab or a different window).

{% note tip %}

To find out where the focus is (on the game or on another window), track the [events](https://yandex.com/dev/games/doc/en/sdk/sdk-events.md#pause-resume) `game_api_resume` and `game_api_pause`.

{% endnote %}

### Gameplay correctly marked {#gameplay-correct}

The indicator color changes depending on the scenario.

<div class="table-50">

#|
|| **Game** | **Comment** ||
|| ![Level selection and start video: when the level appears, the gameplay indicator (gamepad icon) turns green.](../../_images/requirements/1-19-sdk-methods/gameplay/new-lvl-ok.gif) | At the start of a new level, the indicator is green. ||
|| ![Gameplay video: when the level is completed, the gameplay indicator (gamepad icon) changes from green to red.](../../_images/requirements/1-19-sdk-methods/gameplay/lvl-done-ok.gif) | Level completed, the indicator turns red. ||
|| ![Gameplay video: during a level, the gameplay indicator (gamepad icon) is green; when the menu opens, it turns red; after closing the menu, it turns green again.](../../_images/requirements/1-19-sdk-methods/gameplay/menu-close-back-ok.gif) | When navigating to the menu and then returning to the gameplay, the indicator changes. ||
|| ![Gameplay video: during a level, the gameplay indicator (gamepad icon) is green; when the menu opens, it turns red; after closing the menu, it turns green again.](../../_images/requirements/1-19-sdk-methods/gameplay/menu-open-ok.gif) | When navigating to the menu and then returning to the gameplay, the indicator changes. ||
|| ![Gameplay video: when navigating from the game to the in-app purchase store, the gameplay indicator (gamepad icon) changes from green to red. When returning to the game, the indicator turns green.](../../_images/requirements/1-19-sdk-methods/gameplay/purchases-open-close-ok.gif) | When navigating to the purchase menu and then returning to the gameplay, the indicator changes. ||
|| ![Gameplay video: when an ad starts, the gameplay indicator (gamepad icon) changes from green to red. When returning to the game, the indicator turns green.](../../_images/requirements/1-19-sdk-methods/gameplay/ad-closed-ok.gif) | The ad is closed, the indicator color changes from red to green. ||
|| ![Gameplay video: during the game, the gameplay indicator (gamepad icon) is green. When another application (File Explorer) is opened, the indicator turns red. After switching back to the browser tab with the game, the indicator turns green.](../../_images/requirements/1-19-sdk-methods/gameplay/browser-open-ok.gif) | When shifting focus from the browser tab to another window and then returning to the gameplay, the indicator color changes. ||
|#

</div>

### Gameplay marked incorrectly {#gameplay-incorrect}

The indicator color does not change depending on the scenario.

<div class="table-50">

#|
|| **Game** | **Comment** ||
|| ![Gameplay video: after the level ends, the gameplay indicator (gamepad icon) is still green.](../../_images/requirements/1-19-sdk-methods/gameplay/lvl-done-bad.gif) | Level completed, the indicator color did not change from green to red. ||
|| ![Gameplay video: after the menu opens, the gameplay indicator (gamepad icon) is still green.](../../_images/requirements/1-19-sdk-methods/gameplay/menu-open-bad.gif) | When navigating to the menu, the indicator color did not change from green to red. ||
|| ![Gameplay video: when an ad starts, the gameplay indicator (gamepad icon) changes from green to red. After returning to the game, the indicator remains red.](../../_images/requirements/1-19-sdk-methods/gameplay/ad-closed-bad.gif) | The ad is closed, the indicator color did not change from red to green. ||
|| ![Gameplay video: during the game, the gameplay indicator (gamepad icon) is green. When another application (File Explorer) is opened, the indicator remains green.](../../_images/requirements/1-19-sdk-methods/gameplay/browser-open-bad.gif) | When shifting focus from the browser tab to another window, the indicator color does not change. ||
|#

</div>

## Contact Moderation {#forma}

If you believe you are using the SDK methods correctly and your game was incorrectly unpublished or denied, please fill out the form below.

The quality control service of moderation will recheck the decision and return the game if it was unfairly blocked.

<div class="cut-button">

{% cut "Open the form" %}

<div style="padding: 15px;
         margin: 10px 0;
         background: #FFFFFF;
         border-radius: 10px;
         border: 1px solid var(--yc-color-line-generic);">
      <iframe height="400"
              width="100%"
              frameborder="0"
              id="moderation-1-19-form"
              src="https://forms.yandex.com/surveys/13487250.5a13659b18018197b1f339b05e2d4dacc05604a6/?answer_choices_52072484=62278442&iframe=1">
      </iframe>
</div>

{% endcut %}

</div>
