Interface IApiClientOptions

interface IApiClientOptions {
    authTokenGetter: (() => null | string | Promise<null | string>);
    authTokenSetter: ((authenticationToken) => Promise<void>);
    pluginDeveloper: string;
    pluginIcon?: string;
    pluginName: string;
    port?: number;
    url?: string;
    webSocketFactory?: ((url) => IWebSocketLike);
}

Properties

authTokenGetter: (() => null | string | Promise<null | string>)

A callback that will be invoked when an authentication token is needed to authenticate with VTube Studio. Return null from this function if no token is available yet.

Type declaration

    • (): null | string | Promise<null | string>
    • A callback that will be invoked when an authentication token is needed to authenticate with VTube Studio. Return null from this function if no token is available yet.

      Returns null | string | Promise<null | string>

authTokenSetter: ((authenticationToken) => Promise<void>)

A callback that will be invoked when an authentication token needs to be saved by the plugin. Store this token in a location that will persist between application restarts.

Type declaration

    • (authenticationToken): Promise<void>
    • A callback that will be invoked when an authentication token needs to be saved by the plugin. Store this token in a location that will persist between application restarts.

      Parameters

      • authenticationToken: string

      Returns Promise<void>

pluginDeveloper: string

The username of the plugin developer, which will be displayed in VTube Studio.

pluginIcon?: string

A base64-encoded PNG or JPG that is exactly 128x128 pixels which will be displayed in VTube Studio.

pluginName: string

The name of the plugin, which will be displayed in VTube Studio.

port?: number

The port to use when connecting to VTube Studio. Ignored if url is provided. Defaults to 8001.

url?: string

The URL to connect to VTube Studio with. Defaults to ws://localhost:8001.

webSocketFactory?: ((url) => IWebSocketLike)

A user-provided factory function that creates WebSocket instances, for example (url) => new WebSocket(url). Only set this if the library cannot automatically detect a WebSocket implementation in your environment.

Type declaration

    • (url): IWebSocketLike
    • A user-provided factory function that creates WebSocket instances, for example (url) => new WebSocket(url). Only set this if the library cannot automatically detect a WebSocket implementation in your environment.

      Parameters

      • url: string

      Returns IWebSocketLike

Generated using TypeDoc