AvaCapoSDK

Core entry point to initialize and access AvaCapoSDK modules.

Constructor

new AvaCapoSDK(optsopt)

Parameters:
NameTypeAttributesDescription
optsObject<optional>

Initialization options.

Properties
NameTypeAttributesDefaultDescription
apiKeystring<optional>

License API key.

containerHTMLElement | string | null | undefined<optional>

DOM node or CSS selector. Used as default container to render scenes.

preloadArray.<string><optional>
[]

Preload module identifiers (e.g., ['talking']). Will be extended in future to 'AR', 'MoCap', etc.

Examples

Instantiate and init

const sdk = new AvaCapoSDK({ apiKey, container: '#app', preload: ['talking'] });
await sdk.init();

Static factory

const sdk = await AvaCapoSDK.init({ apiKey, container: '#app', preload: ['talking'] });

Classes

AudioManager
PerformanceMonitor
SceneManager
TalkingAvatar

Methods

(async) dispose() → {Promise.<void>}

Dispose SDK resources. Safe to call multiple times.

Returns:
Type: 
Promise.<void>

(async) init() → {Promise.<void>}

Initialize SDK and validate API key. Must be called in a browser environment.

Throws:

Initialization or API key validation failed.

Type
Error
Returns:
Type: 
Promise.<void>

isApiKeyValid() → {boolean}

Check whether the current API key is valid.

Returns:
Type: 
boolean

(async) refreshToken() → {Promise.<boolean>}

Re-validate the current API key token. Returns true if valid after refresh, otherwise throws.

Throws:

Token verification failed.

Type
Error
Returns:
Type: 
Promise.<boolean>

(async) talkingAvatar(containeropt, optionsopt) → {Promise.<TalkingAvatar>}

Create a TalkingAvatar instance.

Parameters:
NameTypeAttributesDescription
containerHTMLElement | string | null | undefined<optional>

DOM node or CSS selector. If not provided, uses the container from SDK init options.

optionsTalkingAvatar.TalkingAvatarOptions<optional>

{@see TalkingAvatar.TalkingAvatarOptions} for details.

Throws:

if no container is provided.

Type
Error
Returns:
Type: 
Promise.<TalkingAvatar>
Example

Examples of different container parameter

avatar = sdk.talkingAvatar('#app', { options })
avatar = sdk.talkingAvatar(document.getElementById('app'), { options })
avatar = sdk.talkingAvatar(null, { options }) // uses container from SDK constructor

(static) checkCompatibility() → {AvaCapoSDK.CompatibilityReport}

Basic capability check for the current environment.

(async, static) init(optsopt) → {Promise.<AvaCapoSDK>}

Parameters:
NameTypeAttributesDescription
optsObject<optional>

Initialization options.

Properties
NameTypeAttributesDefaultDescription
apiKeystring<optional>

License API key.

containerHTMLElement | string<optional>

DOM node or CSS selector. Used as default container to render scenes.

preloadArray.<string><optional>
[]

Preload module identifiers (e.g., ['talking']). Will be extended in future to 'AR', 'MoCap', etc.

Returns:

Initialized SDK instance.

Type: 
Promise.<AvaCapoSDK>

Type Definitions

CompatibilityReport

Type:
  • Object
Properties
NameTypeDescription
webglboolean
wasmboolean
audioContextboolean
fetchboolean
es6boolean
localStorageboolean
compatibleboolean

PerformanceMonitorOptions

Type:
  • Object
Properties
NameTypeAttributesDefaultDescription
containerHTMLElement | null<optional>
null

DOM node to mount the stats overlay into. Defaults to SceneManager.container.

stylestring | null<optional>
null

Inline CSS string applied to the stats root element.