User Management
All users management is through personal or anonymous Ready Player Me accounts.
State management for user management is done through the AuthManager
class. AuthManager
is responsible for creating, loading, and updating the user state necessary for avatar creation and updates.
AuthManager
incorporates a private static session storage, which can be modified by calling specific methods to update the state. The following sections explain how to use these methods effectively.
Creating and logging in of anonymous users
Users who don't have an existing Ready Player Me account can have an anonymous account so that you can still store a list of avatars and assets for them (for your app or game only).
This method creates an anonymous account for the user, enabling them to begin creating avatars without the need for Ready Player Me signup. The anonymous user's data is stored in the userSession
variable.
This method retrieves a previous session from the session
parameter. Sessions can be stored in any preferred location. The example below demonstrates storing the session in PlayerPrefs
and retaining it even after the user closes the application.
Example
Log in to a Ready Player Me account
This method sends a verification code to the provided email address, as shown below.
This method accepts the verification code received via email and an optional userId
parameter to merge the current anonymous account with the Ready Player Me account. By default, the parameter is set to null
, indicating no account merging.
Example
The following method demonstrates how to log in a user and merge their previous anonymous account.
Sessions for both anonymous and Ready Player Me accounts are stored in the userSession
variable similarly. So, if you want to save the session for the user with a logged-in Ready Player Me account, use the same process as in the example above.
Last updated