Step 3: Integrate the WebSpatial SDK into Web Build Tools
Integrate the SDK into your project's toolchain and web server to enable spatial capabilities, while still keeping it a standard, cross-platform website.
📄️ Configure the JS/TS Compiler
To use the WebSpatial API inside a UI framework such as React, you need to integrate WebSpatial's framework SDK (currently only the React SDK) into the JS/TS compiler used by your Web project. This allows the SDK to affect JSX transforms and other stages that involve the HTML/CSS APIs.
📄️ Add Optimizations and Defaults to Web Build Tools
In addition to Configure the JS/TS Compiler, a Web project that includes the WebSpatial SDK needs several essential performance optimizations and default configuration values (convention over configuration). These optimizations and defaults need to be implemented through the project's web build tool and web server.
📄️ Generate a WebSpatial-Specific Website
After integrating the WebSpatial SDK into the project's TS/JS compiler and Web build tool & Web server, your web project can produce a dedicated build for the WebSpatial App Shell, without affecting the original desktop/mobile site.
📄️ Check If Running in WebSpatial Mode
The previous section explained that WebSpatial SDK can automatically build two sets of site assets: