API Reference
This page will list all APIs available in the Genies Avatar SDK.
Checkout the framework pages for User Login, Load an Avatar, and Avatar Editor to see more information on the APIs and examples on how they are used.
Namespaces
GeniesSdkAvatar
namespace Genies.Sdk.Avatar
The main namespace for the Genies Avatar SDK.
Interfaces
IGeniesUser
interface Genies.Sdk.Avatar.IGeniesUser
Provides access to user-related data such as unique ID and username.
Classes
ManagedAvatar
class Genies.Sdk.Avatar.ManagedAvatar
Represents an in-game or in-editor Avatar instance that can be loaded, modified, and managed through the SDK.
Events
LoginEmailOtpCodeRequestFailed
System.Action<(string email, string failReason)> GeniesSdkAvatar.Events.LoginEmailOtpCodeRequestFailed
Triggered when a request to send an email OTP (one-time passcode) fails. Provides the email and reason for failure.
LoginEmailOtpCodeRequestSucceeded
System.Action<string> GeniesSdkAvatar.Events.LoginEmailOtpCodeRequestSucceeded
Triggered when an email OTP code is successfully sent to the user’s email address.
LoginEmailOtpCodeSubmissionFailed
System.Action<(string code, string failReason)> GeniesSdkAvatar.Events.LoginEmailOtpCodeSubmissionFailed
Triggered when the user submits an invalid or expired OTP code. Provides the code and failure reason.
LoginEmailOtpCodeSubmissionSucceeded
System.Action<string> GeniesSdkAvatar.Events.LoginEmailOtpCodeSubmissionSucceeded
Triggered when the OTP code submission is successful and login continues.
LoginPasswordSignInComplete
System.Action<string> GeniesSdkAvatar.Events.LoginPasswordSignInComplete
Triggered when a user successfully signs in using email and password.
LoginPasswordSignInFailed
System.Action<(string email, string failReason)> GeniesSdkAvatar.Events.LoginPasswordSignInFailed
Triggered when password-based login fails. Provides the email and failure reason.
LoginPasswordSignInPendingVerification
System.Action<string> GeniesSdkAvatar.Events.LoginPasswordSignInPendingVerification
Triggered when a password sign-in requires additional verification via code.
LoginPasswordVerificationCodeFailed
System.Action<(string code, string failReason)> GeniesSdkAvatar.Events.LoginPasswordVerificationCodeFailed
Triggered when password verification with a code fails. Provides the code and reason.
LoginPasswordVerificationCodeSucceeded
System.Action<string> GeniesSdkAvatar.Events.LoginPasswordVerificationCodeSucceeded
Triggered when password verification with a code succeeds.
UserLoggedIn
System.Action GeniesSdkAvatar.Events.UserLoggedIn
Triggered when a user has successfully logged in to the Genies platform.
UserLoggedOut
System.Action GeniesSdkAvatar.Events.UserLoggedOut
Triggered when the currently logged-in user logs out.
Parameters
IsAvatarEditorOpen
bool GeniesSdkAvatar.IsAvatarEditorOpen { get; }
Indicates whether the Avatar Editor UI is currently open.
IsAwaitingEmailOtpCode
bool GeniesSdkAvatar.IsAwaitingEmailOtpCode { get; }
Indicates if the SDK is waiting for the user to enter an email OTP code.
IsAwaitingPasswordVerification
bool GeniesSdkAvatar.IsAwaitingPasswordVerification { get; }
Indicates if the SDK is awaiting a password verification code submission.
IsLoggedIn
bool GeniesSdkAvatar.IsLoggedIn { get; }
Indicates whether a user is currently authenticated within the SDK.
UrlGeniesHubSignUp
string GeniesSdkAvatar.UrlGeniesHubSignUp { get; }
Returns the URL for signing up or creating a Genies Hub account.
Methods
CloseAvatarEditorAsync
(awaitable) Cysharp.Threading.Tasks.UniTask GeniesSdkAvatar.CloseAvatarEditorAsync()
Closes the currently open Avatar Editor asynchronously.
EquipOutfitAsync
(awaitable) Cysharp.Threading.Tasks.UniTask GeniesSdkAvatar.EquipOutfitAsync(ManagedAvatar avatar, string wearableId, [System.Threading.CancellationToken cancellationToken = default])
Equips a wearable item (such as clothing or accessories) on the specified Avatar.
EquipTattooAsync
(awaitable) Cysharp.Threading.Tasks.UniTask GeniesSdkAvatar.EquipTattooAsync(ManagedAvatar avatar, string tattooId, GnWrappers.MegaSkinTattooSlot tattooSlot, [System.Threading.CancellationToken cancellationToken = default])
Applies a tattoo to a specific skin slot on the Avatar.
GetAvatarEditorAvatar
ManagedAvatar GeniesSdkAvatar.GetAvatarEditorAvatar()
Returns the Avatar instance being edited from the Avatar Editor.
GetLoggedInUserAsync
(awaitable) Cysharp.Threading.Tasks.UniTask<IGeniesUser> GeniesSdkAvatar.GetLoggedInUserAsync()
Retrieves the user data of the currently logged-in user.
GetUserAsync
(awaitable) Cysharp.Threading.Tasks.UniTask<IGeniesUser> GeniesSdkAvatar.GetUserAsync(string userId, string username)
Fetches user information for a specified user ID or username.
GetUserIdAsync
(awaitable) Cysharp.Threading.Tasks.UniTask<string> GeniesSdkAvatar.GetUserIdAsync()
Retrieves the logged-in user’s unique Genies ID.
GetUserNameAsync
(awaitable) Cysharp.Threading.Tasks.UniTask<string> GeniesSdkAvatar.GetUserNameAsync()
Retrieves the logged-in user’s username.
GetWearableAssetInfoListAsync
(awaitable) Cysharp.Threading.Tasks.UniTask<System.Collections.Generic.List<Genies.AvatarEditor.Core.WearableAssetInfo>> GeniesSdkAvatar.GetWearableAssetInfoListAsync([System.Threading.CancellationToken cancellationToken = default])
Returns a list of all wearable asset metadata available to the current Avatar or user.
InitializeAsync
(awaitable) Cysharp.Threading.Tasks.UniTask<bool> GeniesSdkAvatar.InitializeAsync()
Initializes the Avatar SDK. Is automatically called before using other API functions. Returns whether initialization succeeded.
LoadDefaultAvatarAsync
(awaitable) Cysharp.Threading.Tasks.UniTask<ManagedAvatar> GeniesSdkAvatar.LoadDefaultAvatarAsync([string avatarName = null], [Transform parent = null], [RuntimeAnimatorController playerAnimationController = null])
Loads a default Avatar model into the scene.
LoadUserAvatarAsync
(awaitable) Cysharp.Threading.Tasks.UniTask<ManagedAvatar> GeniesSdkAvatar.LoadUserAvatarAsync([string avatarName = null], [Transform parent = null], [RuntimeAnimatorController playerAnimationController = null])
Loads the logged-in user’s saved Avatar into the scene.
LogOutAsync
(awaitable) Cysharp.Threading.Tasks.UniTask GeniesSdkAvatar.LogOutAsync()
Logs out the current user and clears authentication state.
OpenAvatarEditorAsync
(awaitable) Cysharp.Threading.Tasks.UniTask GeniesSdkAvatar.OpenAvatarEditorAsync(ManagedAvatar avatar, [Camera camera = null])
Opens the Avatar Editor for the specified Avatar instance, optionally targeting a specific camera.
ResendEmailCodeAsync
(awaitable) Cysharp.Threading.Tasks.UniTask<(bool succeeded, string failReason)> GeniesSdkAvatar.ResendEmailCodeAsync()
Re-sends the email verification or OTP code. Returns whether the resend succeeded.
SetSkinColorAsync
(awaitable) Cysharp.Threading.Tasks.UniTask GeniesSdkAvatar.SetSkinColorAsync(ManagedAvatar avatar, Color skinColor, [System.Threading.CancellationToken cancellationToken = default])
Changes the Avatar’s skin color to the specified value.
StartLoginEmailOtpAsync
(awaitable) Cysharp.Threading.Tasks.UniTask<(bool succeeded, string failReason)> GeniesSdkAvatar.StartLoginEmailOtpAsync(string email)
Initiates an email-based OTP login flow by sending a one-time code to the specified email.
StartLoginPasswordAsync
(awaitable) Cysharp.Threading.Tasks.UniTask<(bool succeeded, bool requiresVerification, string failReason)> GeniesSdkAvatar.StartLoginPasswordAsync(string email, string password)
Attempts to log in with email and password. Returns flags for success, verification requirement, and failure reason.
SubmitEmailOtpCodeAsync
(awaitable) Cysharp.Threading.Tasks.UniTask<(bool succeeded, string failReason)> GeniesSdkAvatar.SubmitEmailOtpCodeAsync(string code)
Submits the OTP code received by email to complete login.
SubmitPasswordVerificationCodeAsync
(awaitable) Cysharp.Threading.Tasks.UniTask<(bool succeeded, string failReason)> GeniesSdkAvatar.SubmitPasswordVerificationCodeAsync(string code)
Submits a password verification code to complete two-step authentication.
TryInstantLoginAsync
(awaitable) Cysharp.Threading.Tasks.UniTask<(bool isLoggedIn, string username)> GeniesSdkAvatar.TryInstantLoginAsync()
Attempts an automatic login using stored credentials.
UnEquipOutfitAsync
(awaitable) Cysharp.Threading.Tasks.UniTask GeniesSdkAvatar.UnEquipOutfitAsync(ManagedAvatar avatar, string wearableId, [System.Threading.CancellationToken cancellationToken = default])
Removes a wearable item from the Avatar.
UnEquipTattooAsync
(awaitable) Cysharp.Threading.Tasks.UniTask GeniesSdkAvatar.UnEquipTattooAsync(ManagedAvatar avatar, string tattooId, GnWrappers.MegaSkinTattooSlot tattooSlot, [System.Threading.CancellationToken cancellationToken = default])
Removes a tattoo from the Avatar’s specified skin slot.