Auth: Yes2SDK.auth

← Back to overview

Authentication and account linking. Optional. Guard with isSupported().

Available on CrazyGames and Yandex today. Platform sign-out (signOutAsync) isn't offered by either platform, and account-linking (linkAccountAsync) is CrazyGames-only.


Methods (Core)

SignatureDescription
getCurrentUser(): AuthUser | nullCurrent user, or null.
getCurrentUserAsync(): Promise<AuthUser | null>Async alias (Unity bridge).
signInAsync(provider?: AuthProvider): Promise<AuthUser>Trigger sign-in.
signOutAsync(): Promise<void>Sign out.
getTokenAsync(): Promise<AuthToken>Get a server-verifiable token.
linkAccountAsync(provider: AuthProvider): Promise<void>Link an account provider.
showAccountLinkPromptAsync(): Promise<void>Alias → linkAccountAsync("platform").
isAuthenticated(): booleanWhether the user is authenticated.
isSupported(): booleanWhether auth is supported.

Types: AuthProvider = "facebook" | "google" | "apple" | "platform" | "anonymous"; AuthUser = { id; name; email; photo; provider; isAuthenticated }; AuthToken = { accessToken; expiresAt; refreshToken? }.


Platform support

MethodPokiGameDistributionCrazyGamesYandexYouTube
getCurrentUserNoneNoneReadyReadyNone
signInAsyncNoneNoneReady¹Ready²None
signOutAsyncNoneNoneNone³None³None
getTokenAsyncNoneNoneReady⁴Ready⁵None
linkAccountAsyncNoneNoneReady⁶NoneNone
isAuthenticatedNoneNoneReadyReadyNone
isSupportedNoneNoneReady⁷ReadyNone

¹ sdk.user.showAuthPrompt(). ² ysdk.auth.openAuthDialog() then re-fetches the player. ³ No platform sign-out API. ⁴ sdk.user.getUserToken() (1h local expiry). ⁵ Signed player info (getPlayer({signed:true}) → signature). ⁶ sdk.user.showAccountLinkPrompt(). ⁷ Delegates to sdk.user.isUserAccountAvailable().


Unity (C#)

Yes2SDK.Auth. Available on CrazyGames.

SignatureDescription
bool IsSupported()
void GetCurrentUserAsync(Action<AuthUser> onSuccess = null, Action<Error> onError = null) / Task<AuthUser> …(CancellationToken)
void SignInAsync(Action<AuthUser> …) / Task<AuthUser> …(CancellationToken)
void GetTokenAsync(Action<string> …) / Task<string> …(CancellationToken)User JWT.
void ShowAccountLinkPromptAsync(Action<bool> …) / Task<bool> …(CancellationToken)

AuthUser (struct): Id, Name, Photo, IsAuthenticated.


Defold (Lua)

SignatureDescription
yes2sdk.auth_is_authenticated()Boolean (default false).
yes2sdk.auth_sign_in(callback)Trigger platform sign-in. callback(self, success, err).

Token retrieval and account linking are not exposed in the Defold SDK.

Pitch your game