Environment variables
You can get information about the environment in which the game is running. To do this,
use the ysdk.environment
object.
{
app: {
id: string
},
browser: {
lang: string
},
i18n: {
lang: string;
tld: string;
},
payload: string|nil;
}
Environment object
Contains game environment variables.
Parameter | Type | Description |
---|---|---|
app | table | Game data. |
browser | table | Browser data. |
i18n | table | Internationalization on the service. |
payload | string|nil | The value of the payload parameter from the game address. Optional parameter. For example, for the game https://yandex.com/games/app/123?payload=test the value test can be obtained as follows: ysdk.environment.payload . |
App structure
Parameter | Type | Description |
---|---|---|
id | string | Game identifier. |
Browser structure
Parameter | Type | Description |
---|---|---|
lang | string | Browser language in ISO 639-1 format. |
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 Yandex Games interface. We recommend using this parameter to determine the user's language in the game. |
tld | string | Top-level domain. For example, "com" means that the game is currently running on the international Yandex Games domain. When placing a game on your domain, make sure that it opens correctly on any yandex domain. |