Interface SdkCallback

Event types to listen with sdk.on()

interface SdkCallback {
    assetSet: ((id) => void);
    bodySet: ((id) => void);
    changeParam: ((data) => void);
    export: ((message) => void);
    load: (() => void);
}

Properties

export: ((message) => void)

Fires when a user pressed button "Next".

@event

Type declaration

Events

assetSet: ((id) => void)

Fires when a user changed asset on the avatar. Only works with sessions created with Avaturn API.

Type declaration

    • (id): void
    • Parameters

      • id: string

      Returns void

bodySet: ((id) => void)

Fires when a user changed body of the avatar. Only works with sessions created with Avaturn API.

Type declaration

    • (id): void
    • Parameters

      • id: string

      Returns void

changeParam: ((data) => void)

Fires when user changed a parameter (currently only hair color is supported). Only works with sessions created with Avaturn API.

Type declaration

    • (data): void
    • Parameters

      • data: {
            key: "hair_color";
            value: string;
        }
        • key: "hair_color"
        • value: string

      Returns void

load: (() => void)

Load event fires when avatar editor is fully loaded and ready to show avatar. Only works with sessions created with Avaturn API.

sdk.on('load', (data) => {
log('[callback] Avatar exported: ' + data);
})

Type declaration

    • (): void
    • Returns void