Skip to main content

API Reference

This page will list all APIs available in the Genies Avatar SDK.

tip

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

GeniesSdk

namespace Genies.Sdk

The main namespace for all Genies SDK tools.

Classes

AvatarSdk

class Genies.Sdk.AvatarSdk

The main class with the methods, events, and parameters for the Genies Avatar SDK.

ManagedAvatar

class Genies.Sdk.ManagedAvatar

Represents an in-game or in-editor Avatar instance that can be loaded, modified, and managed through the SDK.

ManagedAvatarComponent

class Genies.Sdk.ManagedAvatarComponent

The MonoBehaviour component attached to the Avatar's root GameObject. Provides a bridge between Unity's GameObject system and this ManagedAvatar wrapper.

Interfaces

IGeniesUser

interface Genies.Sdk.IGeniesUser

Provides access to user-related data such as unique ID and username.

Enums

BodySize

enum Genies.Sdk.BodySize

Represents the types of body sizes an Avatar can be set.

Gender Types

enum Genies.Sdk.GenderType

Represents the types of genders an Avatar can be set.

Events

LoginEmailOtpCodeRequestFailed

System.Action<(string email, string failReason)> Genies.Sdk.AvatarSdk.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> Genies.Sdk.AvatarSdk.Events.LoginEmailOtpCodeRequestSucceeded

Triggered when an email OTP code is successfully sent to the user’s email address.

LoginEmailOtpCodeSubmissionFailed

System.Action<(string code, string failReason)> Genies.Sdk.AvatarSdk.Events.LoginEmailOtpCodeSubmissionFailed

Triggered when the user submits an invalid or expired OTP code. Provides the code and failure reason.

LoginEmailOtpCodeSubmissionSucceeded

System.Action<string> Genies.Sdk.AvatarSdk.Events.LoginEmailOtpCodeSubmissionSucceeded

Triggered when the OTP code submission is successful and login continues.

LoginPasswordSignInComplete

System.Action<string> Genies.Sdk.AvatarSdk.Events.LoginPasswordSignInComplete

Triggered when a user successfully signs in using email and password.

LoginPasswordSignInFailed

System.Action<(string email, string failReason)> Genies.Sdk.AvatarSdk.Events.LoginPasswordSignInFailed

Triggered when password-based login fails. Provides the email and failure reason.

LoginPasswordSignInPendingVerification

System.Action<string> Genies.Sdk.AvatarSdk.Events.LoginPasswordSignInPendingVerification

Triggered when a password sign-in requires additional verification via code.

LoginPasswordVerificationCodeFailed

System.Action<(string code, string failReason)> Genies.Sdk.AvatarSdk.Events.LoginPasswordVerificationCodeFailed

Triggered when password verification with a code fails. Provides the code and reason.

LoginPasswordVerificationCodeSucceeded

System.Action<string> Genies.Sdk.AvatarSdk.Events.LoginPasswordVerificationCodeSucceeded

Triggered when password verification with a code succeeds.

UserLoggedIn

System.Action Genies.Sdk.AvatarSdk.Events.UserLoggedIn

Triggered when a user has successfully logged in to the Genies platform.

UserLoggedOut

System.Action Genies.Sdk.AvatarSdk.Events.UserLoggedOut

Triggered when the currently logged-in user logs out.

Parameters

IsAvatarEditorOpen

bool Genies.Sdk.AvatarSdk.IsAvatarEditorOpen { get; }

Indicates whether the Avatar Editor UI is currently open.

IsAwaitingEmailOtpCode

bool Genies.Sdk.AvatarSdk.IsAwaitingEmailOtpCode { get; }

Indicates if the SDK is waiting for the user to enter an email OTP code.

IsAwaitingPasswordVerification

bool Genies.Sdk.AvatarSdk.IsAwaitingPasswordVerification { get; }

Indicates if the SDK is awaiting a password verification code submission.

IsLoggedIn

bool Genies.Sdk.AvatarSdk.IsLoggedIn { get; }

Indicates whether a user is currently authenticated within the SDK.

UrlGeniesHubSignUp

string Genies.Sdk.AvatarSdk.UrlGeniesHubSignUp { get; }

Returns the URL for signing up or creating a Genies Hub account.

Methods

CloseAvatarEditorAsync

(awaitable) Cysharp.Threading.Tasks.UniTask Genies.Sdk.AvatarSdk.CloseAvatarEditorAsync()

Closes the currently open Avatar Editor asynchronously.

EquipOutfitAsync

(awaitable) Cysharp.Threading.Tasks.UniTask Genies.Sdk.AvatarSdk.EquipOutfitAsync(ManagedAvatar avatar, string wearableId, [System.Threading.CancellationToken cancellationToken = default])

Equips a wearable item (such as clothing, accessories - any item in the Outftit category) on the specified Avatar.

Outfit Category

GetAvatarEditorAvatar

ManagedAvatar Genies.Sdk.AvatarSdk.GetAvatarEditorAvatar()

Returns the Avatar instance being edited from the Avatar Editor.

GetLoggedInUserAsync

(awaitable) Cysharp.Threading.Tasks.UniTask<IGeniesUser> Genies.Sdk.AvatarSdk.GetLoggedInUserAsync()

Retrieves the user data of the currently logged-in user.

GetUserAsync

(awaitable) Cysharp.Threading.Tasks.UniTask<IGeniesUser> Genies.Sdk.AvatarSdk.GetUserAsync(string userId, string username)

Fetches user information for a specified user ID or username.

GetUserIdAsync

(awaitable) Cysharp.Threading.Tasks.UniTask<string> Genies.Sdk.AvatarSdk.GetUserIdAsync()

Retrieves the logged-in user’s unique Genies ID.

GetUserNameAsync

(awaitable) Cysharp.Threading.Tasks.UniTask<string> Genies.Sdk.AvatarSdk.GetUserNameAsync()

Retrieves the logged-in user’s username.

GetUsersAssetsAsync

(awaitable) Cysharp.Threading.Tasks.UniTask<List<WearableAssetInfo>> Genies.Sdk.AvatarSdk.GetUsersAssetsAsync()

Gets the assets of the logged in user. Returns a list of WearableAssetInfo structs containing AssetId, AssetType, Name, and Category.

GetWearableAssetInfoListAsync

(awaitable) Cysharp.Threading.Tasks.UniTask<System.Collections.Generic.List<Genies.AvatarEditor.Core.WearableAssetInfo>> Genies.Sdk.AvatarSdk.GetWearableAssetInfoListAsync([System.Threading.CancellationToken cancellationToken = default])

Returns a list of all wearable asset metadata available to the current Avatar or user.

GiveAssetToUserAsync

(awaitable) Cysharp.Threading.Tasks.UniTask<(bool succeeded, string failReason)> Genies.Sdk.AvatarSdk.GetUsersAssetsAsync()

Grants an asset specified by the assetId to a user, adding it to their inventory. If the user already has the asset, the method will return true with a string noting that the user already has the asset.

InitializeAsync

(awaitable) Cysharp.Threading.Tasks.UniTask<bool> Genies.Sdk.AvatarSdk.InitializeAsync()

Initializes the Avatar SDK. Is automatically called before using other API functions. Returns whether initialization succeeded.

LoadDefaultAvatarAsync

(awaitable) Cysharp.Threading.Tasks.UniTask<ManagedAvatar> Genies.Sdk.AvatarSdk.LoadDefaultAvatarAsync([string avatarName = null], [Transform parent = null], [RuntimeAnimatorController playerAnimationController = null])

Loads a default Avatar model into the scene.

LoadFromLocalAvatarDefinitionAsync

(awaitable) Cysharp.Threading.Tasks.UniTask<ManagedAvatar> Genies.Sdk.AvatarSdk.LoadFromLocalAvatarDefinitionAsync(string profileId, CancellationToken cancellationToken = default)

Loads an Avatar definition from a local persistent json file. Returns a ManagedAvatar or null if failed.

LoadFromLocalGameObjectAsync

(awaitable) Cysharp.Threading.Tasks.UniTask<ManagedAvatar> Genies.Sdk.AvatarSdk.LoadFromLocalGameObjectAsync(string profileId, CancellationToken cancellationToken = default)

Loads an Avatar from a local GameObject. Returns a ManagedAvatar or null if failed.

LoadUserAvatarAsync

(awaitable) Cysharp.Threading.Tasks.UniTask<ManagedAvatar> Genies.Sdk.AvatarSdk.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 Genies.Sdk.AvatarSdk.LogOutAsync()

Logs out the current user and clears authentication state.

OpenAvatarEditorAsync

(awaitable) Cysharp.Threading.Tasks.UniTask Genies.Sdk.AvatarSdk.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)> Genies.Sdk.AvatarSdk.ResendEmailCodeAsync()

Re-sends the email verification or OTP code. Returns whether the resend succeeded.

SaveAvatarDefinitionLocallyAsync

(awaitable) Cysharp.Threading.Tasks.UniTask Genies.Sdk.AvatarSdk.SaveAvatarDefinitionLocallyAsync(ManagedAvatar avatar, string profileId = null)

Saves the current Avatar definition to both json on device for local persistent data as well as to a scriptable object in Resources. The profileId is the name it saves to.

SetAvatarBodyTypeAsync

(awaitable) Cysharp.Threading.Tasks.UniTask Genies.Sdk.AvatarSdk.SetAvatarBodyTypeAsync(ManagedAvatar avatar, GenderType genderType, BodySize bodySize, CancellationToken cancellationToken = default)

Sets the Avatar body type with specified gender and body size.

SetEditorSaveLocallyAndContinueAsync

(awaitable) Cysharp.Threading.Tasks.UniTask Genies.Sdk.AvatarSdk.SetEditorSaveLocallyAndContinueAsync(string profileId)

Sets the Avatar Editor to save locally and continue editing.

SetEditorSaveLocallyAndExitAsync

(awaitable) Cysharp.Threading.Tasks.UniTask Genies.Sdk.AvatarSdk.SetEditorSaveLocallyAndExitAsync(string profileId)

Sets the Avatar Editor to save locally and exit the editor.

SetEditorSaveRemotelyAndContinueAsync

(awaitable) Cysharp.Threading.Tasks.UniTask Genies.Sdk.AvatarSdk.SetEditorSaveRemotelyAndContinueAsync()

Sets the Avatar Editor to save to the cloud and continue editing.

SetEditorSaveRemotelyAndExitAsync

(awaitable) Cysharp.Threading.Tasks.UniTask Genies.Sdk.AvatarSdk.SetEditorSaveRemotelyAndExitAsync()

Sets the Avatar Editor to save to the cloud and exit the editor.

SetSkinColorAsync

(awaitable) Cysharp.Threading.Tasks.UniTask Genies.Sdk.AvatarSdk.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)> Genies.Sdk.AvatarSdk.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)> Genies.Sdk.AvatarSdk.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)> Genies.Sdk.AvatarSdk.SubmitEmailOtpCodeAsync(string code)

Submits the OTP code received by email to complete login.

SubmitPasswordVerificationCodeAsync

(awaitable) Cysharp.Threading.Tasks.UniTask<(bool succeeded, string failReason)> Genies.Sdk.AvatarSdk.SubmitPasswordVerificationCodeAsync(string code)

Submits a password verification code to complete two-step authentication.

TryInstantLoginAsync

(awaitable) Cysharp.Threading.Tasks.UniTask<(bool isLoggedIn, string username)> Genies.Sdk.AvatarSdk.TryInstantLoginAsync()

Attempts an automatic login using stored credentials.

UnEquipOutfitAsync

(awaitable) Cysharp.Threading.Tasks.UniTask Genies.Sdk.AvatarSdk.UnEquipOutfitAsync(ManagedAvatar avatar, string wearableId, [System.Threading.CancellationToken cancellationToken = default])

Removes a wearable item from the Avatar.