Player authorization and data

You can save game state data (completed levels, experience, in-game purchases, etc.) on Yandex's server or send it to your server. You can also personalize the game using some data from the user's Yandex profile, such as their name.

Player Information

To start working with player data, use the Using player info condition. This special condition requests user permission and retrieves player data from Yandex Games for further use.

With this condition, you can access the user's authorization check, retrieve their name, and more. Note that all logic using this information should be placed inside Using player info.

Warning

Ensure this condition isn't called multiple times consecutively. It’s recommended to use it inside functions or a trigger like "On Layout Start".

Inside the Using player info condition, you have access to:

  • Player is authorized condition: Checks if the player is authorized on Yandex.
  • Player info access granted condition: Checks if the player's personal data has been obtained.
  • Player signature expression: A string containing user data from the Yandex profile and a signature. Consists of two Base64-encoded strings.
  • Player avatar expression: A string representing the player's avatar URL.
  • Player name expression: A string representing the player's name.
  • Player unique id expression: A string representing the player's unique identifier.

Player Authorization Example

In-Game Data

To work with in-game user data, use these actions:

  • Get player data: Requests in-game user data and writes it to a JSON object.
  • Set player data: Sends in-game user data to Yandex Games from a JSON object.
  • Get player stats: Requests numerical user data and writes it to a JSON object.
  • Set player stats: Sends numerical user data to Yandex Games from a JSON object.
  • Increment player stats: Increases numerical user data by a specified value.

Player Data Save/Load Example

Warning

All these actions are asynchronous, meaning their execution takes time. Don’t forget to use the Wait for previous actions action to avoid errors.


Repository