Banuba WebAR JavaScript API Reference
    Preparing search index...

    Type Alias SDKOptions

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

    Properties

    canvas?: HTMLCanvasElement

    Ordinary you won't use the option

    Overrides internal canvas element used for WebGL rendering

    HTMLCanvasElement
    
    clientToken: string

    Banuba Client token

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

    const player = await Player.create({
    clientToken: "xxx-xxx-xxx",
    locateFile: "static/webar/",
    })
    const player = await Player.create({
    clientToken: "xxx-xxx-xxx",
    locateFile: (fileName) => "static/webar/" + fileName,
    })
    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
    },
    })
    logger?: Logger

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

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