Documentation

​
​

Development

User Acquisition

Monetization

Industry

Authentication

Unity SDK

Admin API

Client API

Open Unity Dashboard

Authentication

LiveOps
​
​
Authentication
  • Overview
  • Get started
  • Concepts
  • Tutorials
    • Anonymous sign-in
    • Google Play Games
    • Apple Game Center
    • Steam
    • Facebook
    • Unity Player Accounts
    • Oculus
    • Username and Password
    • Code-Link
    • Google
    • Apple
    • Custom OpenID Connect
    • Custom ID
  • Reference
  • Privacy and consent
  1. Unity Authentication

Use anonymous sign-in

Implement anonymous sign-in to create new players without requiring any sign-in credentials or player input.
Read time 1 minute
Last updated 9 months ago

Anonymous sign-in creates a new player for the game session without any input from the player. It's a quick way for a player to get started with your game.
Warning
You cannot recover anonymous accounts that are not linked to a platform-specific account and if the session token is lost. For example, the player will not be able to log in to their anonymous account if they uninstall and then reinstall the game.
If a session token is cached on the SDK, then the
SignInAnonymouslyAsync()
method recovers the existing credentials of the cached player, regardless of whether they signed in anonymously or through a platform account. If there is no player sign-in information, this method creates a new anonymous player.
Note
For more information about signing in returning players, refer to Sign In a Cached Player.
The following code sample shows how sign in to your game anonymously.
async Task SignUpAnonymouslyAsync(){ try { await AuthenticationService.Instance.SignInAnonymouslyAsync(); Debug.Log("Sign in anonymously succeeded!"); // Shows how to get the playerID Debug.Log($"PlayerID: {AuthenticationService.Instance.PlayerId}"); } catch (AuthenticationException ex) { // Compare error code to AuthenticationErrorCodes // Notify the player with the proper error message Debug.LogException(ex); } catch (RequestFailedException ex) { // Compare error code to CommonErrorCodes // Notify the player with the proper error message Debug.LogException(ex); }}
After implementing anonymous sign-in, it is recommended to integrate with at least one supported external identity provider to allow your players to continue their progress from another device or recover their account, if needed.

Copyright © 2026 Unity Technologies
LegalPrivacy PolicyCookiesDocumentation Terms of UseDo Not Sell or Share My Personal InformationYour Privacy Choices (Cookie Settings)

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S and elsewhere (more info here). Other names or brands are trademarks of their respective owners.

Some pages are machine-translated for convenience, and may contain inaccuracies. In the event of conflicting information, the English version is authoritative.


    Report a problem with this page