Constructor
new AvaCapoSDK(optsopt)
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts | Object | <optional> | Initialization options. Properties
|
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
Methods
(async) dispose() → {Promise.<void>}
Dispose SDK resources. Safe to call multiple times.
- Type:
- Promise.<void>
(async) init() → {Promise.<void>}
Initialize SDK and validate API key. Must be called in a browser environment.
Initialization or API key validation failed.
- Type
- Error
- Type:
- Promise.<void>
isApiKeyValid() → {boolean}
Check whether the current API key is valid.
- Type:
- boolean
(async) refreshToken() → {Promise.<boolean>}
Re-validate the current API key token. Returns true if valid after refresh, otherwise throws.
Token verification failed.
- Type
- Error
- Type:
- Promise.<boolean>
(async) talkingAvatar(containeropt, optionsopt) → {Promise.<TalkingAvatar>}
Create a TalkingAvatar instance.
| Name | Type | Attributes | Description |
|---|---|---|---|
container | HTMLElement | | <optional> | DOM node or CSS selector. If not provided, uses the container from SDK init options. |
options | TalkingAvatar. | <optional> | {@see TalkingAvatar.TalkingAvatarOptions} for details. |
if no container is provided.
- Type
- Error
- Type:
- Promise.<TalkingAvatar>
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>}
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts | Object | <optional> | Initialization options. Properties
|
Initialized SDK instance.
- Type:
- Promise.<AvaCapoSDK>
Type Definitions
CompatibilityReport
- Object
| Name | Type | Description |
|---|---|---|
webgl | boolean | |
wasm | boolean | |
audioContext | boolean | |
fetch | boolean | |
es6 | boolean | |
localStorage | boolean | |
compatible | boolean |
PerformanceMonitorOptions
- Object
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
container | HTMLElement | | <optional> | null | DOM node to mount the stats overlay into. Defaults to SceneManager.container. |
style | string | | <optional> | null | Inline CSS string applied to the stats root element. |