Skip to content

Yandex Games auth for web games

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.

Choose an environment in the header, open Project settings → Authentication and add a Yandex Games connection.

FieldMeaning
SecretThe 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.

The game asks for the signed player and sends the signature as it is — a string, not an object.

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 },
});

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.

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.

  • A signature that does not match the secret answers 401 unauthorized.

The rest are in Errors.