SDKOptions: {
    canvas?: HTMLCanvasElement;
    clientToken: string;
    locateFile?: BanubaSDKBinaryFileLocator;
    logger?: Logger;
}

Type declaration

  • Optional canvas?: HTMLCanvasElement

    Ordinary you won't use the option

    Overrides internal canvas element used for WebGL rendering

    Default

    HTMLCanvasElement
    
  • clientToken: string

    Banuba Client token

  • Optional locateFile?: BanubaSDKBinaryFileLocator

    Where to find .wasm and .data files relative to the page running the script

    Example

    const player = await Player.create({
    clientToken: "xxx-xxx-xxx",
    locateFile: "static/webar/",
    })

    Example

    const player = await Player.create({
    clientToken: "xxx-xxx-xxx",
    locateFile: (fileName) => "static/webar/" + fileName,
    })

    Example

    const player = await Player.create({
    clientToken: "xxx-xxx-xxx",
    locateFile: {
    "BanubaSDK.data": "static/webar/BanubaSDK.data",
    "BanubaSDK.wasm": "static/webar/BanubaSDK.wasm",
    "BanubaSDK.simd.wasm": "static/webar/BanubaSDK.simd.wasm", // .simd.wasm is optional
    },
    })
  • Optional logger?: Logger

    A custom logger instance, pass {} to suppress all outputs

    Default

    { warn: console.warn, error: console.error }