Yandex Games auth for web games
Before you start
Section titled “Before you start”A game on Yandex Games. The secret key of the game comes from In-app purchases → Settings of the Yandex Games Developer Console, and Yandex shows it after you connect in-app purchases. The game runs inside the Yandex Games page with their SDK: the signature exists only there.
In the Dashboard
Section titled “In the Dashboard”Choose an environment in the header, open Project settings → Authentication and add a Yandex Games connection.
| Field | Meaning |
|---|---|
Secret | The secret key of the game. The signature is checked with it, so enter the secret Yandex Games issued: one generated by Rudder will never match a signature. |
In the game
Section titled “In the game”The game asks for the signed player and sends the signature as it is — a string, not an object.
TypeScript
Section titled “TypeScript”import { Session } from '@rudder/sdk';
const player = await ysdk.getPlayer({ signed: true });
const session = await Session.signIn(key, { provider: 'yandex-games', payload: { signature: player.signature },});C# and Unity
Section titled “C# and Unity”A WebGL build reaches the SDK of Yandex Games through a JavaScript bridge and sends the same string:
using RudderSdk;
var session = await Session.SignInAsync(key, new ProviderSignIn{ Provider = "yandex-games", Payload = new Dictionary<string, object?> { ["signature"] = signatureFromTheBridge },});A native build has no page of Yandex Games around it, so it cannot sign in this way.
What the platform checks
Section titled “What the platform checks”The platform recomputes the signature with the secret of the game and refuses a mismatch. The player is the permanent Yandex Games id of the profile; its name and avatar fill a nickname and an avatar the player does not have yet.
Errors
Section titled “Errors”- A signature that does not match the secret answers
401 unauthorized.
The rest are in Errors.