Environment variables

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

1{
2    app: {
3        id: string
4    },
5    i18n: {
6        lang: string
7    },
8    payload: string|nil
9}

Environment object

Contains game environment variables.

Parameter

Type

Description

app

table

Game data.

i18n

table

Service internationalization.

payload

string|nil

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 in the Turkish interface of Yandex Games. Use this parameter to automatically detect the user's language in the game (item 2.14).


Repository