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 |
|
object |
Game data. |
|
object |
Service internationalization. |
|
string |
The value of the |
app structure
Parameter |
Type |
Description |
|
string |
Game ID. |
i18n structure
Parameter |
Type |
Description |
|
string |
Yandex Games interface language in ISO 639-1 format. For example, |
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:
Game data.
Game ID.
Service internationalization.
The 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. We recommend using this parameter to determine the user's language in the game.
Top-level domain. For example, "com"
means that the game is currently running under the Yandex Games international domain. When hosting the game on your domain, keep in mind that it must open correctly on any Yandex domain.
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
.