Skip to main content

Getting Started

XR Blocks is a lightweight, cross-platform library for rapidly prototyping advanced XR and AI experiences. Built upon three.js, it targets Chrome v136+ with WebXR support on Android XR (such as Samsung Galaxy XR and XREAL Aura) and includes a desktop simulator for rapid development on standard desktop browsers.

XR Blocks supports two primary development workflows:

  • Develop Online: Fast, zero-setup prototyping using generative AI in the browser.
  • Develop Locally: Full development workflow with local web servers, development tools, and the built-in desktop simulator.

Develop Online​

For the fastest way to explore ideas and build spatial prototypes without configuring a local development environment, you can develop directly online using Google AI tools:

Google AI Studio​

Google AI Studio serves as an online IDE for rapid spatial computing and AI development. You can build, iterate on, and run applications directly inside of it without installing any local developer tooling.

  • Online IDE: Build, preview, and run complete XR Blocks apps directly inside the browser environment.
  • Framework Selection: Navigating to goo.gle/BuildXR automatically selects "XR Blocks" as the framework and configures the environment. You can also select "XR Blocks" manually within the AI Studio settings.
  • Gemini Models & Prompts: Prototype multimodal prompts, test system instructions, and experiment with real-time features such as Gemini Live.
  • API Keys: Manage and obtain API keys to power generative AI features (like multimodal scene queries and speech interaction) in your XR Blocks projects.

Gemini Canvas with XR Blocks Gem​

The XR Blocks Gem leverages Gemini with Canvas to enable "vibe coding" for spatial computing. You can describe your scene, interactions, 3D models, and spatial UI in plain English, and the Gem will:

  • Generate complete, runnable XR Blocks code.
  • Provide live, interactive previews in the browser.
  • Support conversational iteration—simply ask the Gem to modify lighting, add animations, adjust physics, or insert generative AI features.

To learn more about vibe coding with XR Blocks:


Develop Locally​

Developing locally gives you full control over your project structure, version control, build pipeline, and custom assets.

Basic Requirements​

Before setting up a local XR Blocks project, ensure your environment meets the following requirements:

  1. Supported Browser & Platform:
    • Android XR: An Android XR headset (such as Samsung Galaxy XR or XREAL Aura) running Chrome v136+ with WebXR enabled.
    • Desktop (Simulator): Google Chrome on macOS, Windows, or Linux. XR Blocks includes a built-in desktop simulator, so an XR headset is not required to build and test applications.
  2. Local Web Server:
    • WebXR APIs and modern JavaScript ES modules cannot be loaded directly from local files (file://). You must serve your project files over HTTP/HTTPS using any local web server (for example, npx http-server, npx serve, or the Vite dev server).
  3. Headset Remote Debugging (Optional):
    • When deploying to an Android XR headset, you can connect the headset to your computer via USB or Wi-Fi and use Chrome Remote Debugging (chrome://inspect) with port forwarding, or serve over an HTTPS tunnel (such as ngrok or cloudflared).
  4. Node.js & npm (Optional):
    • Node.js is required if you want to use npm packages, TypeScript, or a bundler like Vite or Rollup. If you choose to use CDN import maps, no Node.js installation or build step is needed.

Project Setup​

To install XR Blocks, configure your import map or bundler, and start writing your first interactive scene, proceed to the Project Setup guide.