Constructor does not perform actual initialization. After creating object use AvaturnSDK.init to actually initialize SDK.
Initializes SDK, creates DOM elements for Avaturn. Returns a promise that resolves when Avaturn inside iframe is initialized.
DOM element that will be parent for all DOM elements created by SDK.
Config for initialization.
sdk.init(containerRef, {
url: "<INSERT URL FROM /sessions/new request>"
iframeClassName: 'sdk-iframe',
disableUi: true,
})
Gets a list of available animations and their preview urls.
Changes the current active animation to the specified one.
Animation id, one of ids returned by getAnimationList
Promise which resolves once the animation is changed.
Gets a list of active assets for Avaturn in a form of dictionary {category: assetId }. If some category does not have an active item, empty string instead of asset id is returned.
It's best to Avaturn state as source of truth because Avaturn automatically fixes inconsistencies such as when a developer calls .setActiveAsset()
with incorrect id or when activating one asset leads to deactivating another one.
Changes the current active body to the specified one.
Body id, one of ids returned by getBodyList
Promise which resolves once the body is changed.
Set callback to receive particular events.
Initiates avatar export.
Gets information about the current proportions.
Gets information about the current eye color (only for T2 avatars).
Sets body proportions.
one of head | arms | chest
Number from -50 to 50. 0 = no correction.
Sets eye color.
string, see EyeColorType
Main SDK class