Initialize Cesium Viewer with Nextspace API

HTML

<script src="https://nextspace-limited.github.io/nextspace-web-bundle/dist/nextspace.js?v1"></script>
<div id="VIEWER"></div>

CSS

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

#VIEWER {
    width: 100%;
    height: 100%;
}

JavaScript

// Setup global defaults.
BModels.ENVIRONMENT.Reset({
    // Replace with your Client Account ID.
    accountId: "examples",
    // Nextspace examples run on a DEV server.
    // Remove this when connecting to your data.
    env: BModels.Api.EEnv.DEV,
    // Important if your Project Views are not set to be publicly accessible.
    sessionId: ""
});

const init = async () => {
    // Proxy Cesium Ion requests through the Nextspace API.
    // This allows for access to Cesium Ion resources without exposing your token, or the default token.
    const api = BModels.ENVIRONMENT.Api().GetBruceApi({});
    await api.Loading;
    Cesium.Ion.defaultServer = api.GetBaseUrl() + "proxy/cesium-ion/";
    Cesium.Ion.defaultAccessToken = "proxy";

    const container = document.getElementById("VIEWER");
    const viewer = new Cesium.Viewer(container, {
        // Excluding the default imagery and terrain providers.
        // This is to avoid consuming Cesium Ion or Bing Maps quota before custom tiles load.
        imageryProvider: false,
        baseLayerPicker: false,
        terrainProvider: null
    });

    // Rendering some defaults that work well without requiring a Cesium token.
    await BEngine.TileRenderEngine.Map.Navigator.Render({
        tiles: [
            {
                tilesetId: BModels.ProjectViewTile.EDefaultImagery.MapBoxStreets
            }
        ],
        viewer: viewer
    });

    await BEngine.TileRenderEngine.Terrain.Navigator.Render({
        tile: {
            tilesetId: BModels.ProjectViewTile.EDefaultTerrain.FlatTerrain
        },
        viewer: viewer
    });

    // First initialize the viewer without widgets.
    BEngine.ViewerUtils.InitViewer({
        viewer: viewer,
        // True if you're seeing default Cesium widgets.
        destroyWidgets: false,
        nextspaceWidgets: false
    });

    // Then create the specific widgets.
    const widgets =...