Step 1: Install the WebSpatial SDK
Core runtime dependencies
- npm
- pnpm
- Yarn
npm install @webspatial/react-sdk @webspatial/core-sdk @google/model-viewer three
pnpm add @webspatial/react-sdk @webspatial/core-sdk @google/model-viewer three
yarn add @webspatial/react-sdk @webspatial/core-sdk @google/model-viewer three
@google/model-viewer
and three
are dependencies used inside the SDK, but their package sizes are relatively large compared to the SDK itself. Plus, many web projects might already use them, and having multiple versions installed could cause conflicts. In the future, the SDK might remove direct dependencies on them. So, they're declared as peerDependencies for now, you'll need to install them explicitly in your web project.
@webspatial/react-sdk
The SDK offered by WebSpatial for React, which can be plugged into existing regular React projects to enable immediate use of the WebSpatial API.
@webspatial/core-sdk
Both the React SDK (and forthcoming SDKs for other Web frameworks) are implemented on top of the Core SDK. The Core SDK is a framework-agnostic, lower-level pure-JS API that relies internally on a non-standard JS Bridge API so that the WebSpatial App Shell can natively spatialize 2D HTML content and render 3D content.
Core build-time dependencies
- npm
- pnpm
- Yarn
npm install -D @webspatial/builder
pnpm add -D @webspatial/builder
yarn add --dev @webspatial/builder
@webspatial/builder
WebSpatial's packaging tool turns your website into a Packaged WebSpatial App. It's the must-have dev tool right now for developing, testing, and distributing WebSpatial apps on visionOS.
See "Step 2: Add the WebSpatial App Build Tool" for how to use it.
Optional core build-time dependencies
These optional dependencies let each Web project include only the platform support it actually needs, keeping builds lean.
@webspatial/platform-visionos
- npm
- pnpm
- Yarn
npm install -D @webspatial/platform-visionos
pnpm add -D @webspatial/platform-visionos
yarn add --dev @webspatial/platform-visionos
Includes the WebSpatial App Shell needed to generate a visionOS app and provide spatial capabilities.
This package is currently required, as visionOS is the sole spatial computing platform supported by WebSpatial at this stage.
To build and package a visionOS app and debug it in the visionOS simulator, you need to install the relevant global dependencies: Xcode and the visionOS Simulator.
Prerequisite: a Mac computer
Steps:
- Open the Mac App Store, search for "Xcode", and install it.
- On first launch, agree to the license and enter the admin password to install additional components.
- Click the top menu "Xcode" > "Settings…". In the "Components" tab, find visionOS and visionOS Simulator under "Platform Support", then install both.
Non-core build-time dependencies
These plugins integrate with popular third-party toolchains to simplify setup and apply essential performance optimizations and sensible defaults.
@webspatial/vite-plugin
If you use a React + Vite project:
- npm
- pnpm
- Yarn
npm install -D @webspatial/vite-plugin
pnpm add -D @webspatial/vite-plugin
yarn add --dev @webspatial/vite-plugin
WebSpatial's Vite plugin adds the required optimizations and defaults when your Web project uses Vite as its web build tool and web server.
@webspatial/next-plugin
If you use a React + Next.js project:
- npm
- pnpm
- Yarn
npm install -D @webspatial/next-plugin
pnpm add -D @webspatial/next-plugin
yarn add --dev @webspatial/next-plugin
WebSpatial's Next.js plugin adds the required optimizations and defaults when your Web project is based on Next.js framework.
@webspatial/rsbuild-plugin
If you use a React + Rsbuild project:
- npm
- pnpm
- Yarn
npm install -D @webspatial/rsbuild-plugin
pnpm add -D @webspatial/rsbuild-plugin
yarn add --dev @webspatial/rsbuild-plugin
WebSpatial's Rsbuild plugin adds the required optimizations and defaults when your Web project uses Rsbuild as its web build tool and web server.
@webspatial/rspack-plugin
If you use a React + Rspack project:
- npm
- pnpm
- Yarn
npm install -D @webspatial/rspack-plugin
pnpm add -D @webspatial/rspack-plugin
yarn add --dev @webspatial/rspack-plugin
WebSpatial's Rspack plugin adds the required optimizations and defaults when your Web project uses Rspack as its web build tool and web server.