Environment variables

You can get information about the environment the game is run in. To do this, use the environment object.

{
  app: {
    id: string;
  };
  i18n: {
    lang: string;
    tld: string;
  };
  payload?: string;
}

Environment object

Contains game environment variables.

Parameter

Type

Description

app

object

Game data.

i18n

object

Service internationalization.

payload

string

The value of the payload parameter from the game's address. Optional parameter. For example, in https://yandex.ru/games/app/123?payload=test you can return test as follows: ysdk.environment.payload.

app structure

Parameter

Type

Description

id

string

Game ID.

i18n structure

Parameter

Type

Description

lang

string

Yandex Games interface language in ISO 639-1 format. For example, "tr" means that the game is currently running under the Yandex Games Turkish interface. Use this parameter to determine the user's language in the game.


Note

Our support team can help publish finished games or WebApps on Yandex Games. If you have any questions about development or testing, ask them in the Discord channel.

If you are facing an issue or have a question regarding the use of Yandex Games SDK, please contact support:

Write to chat