import { Badge } from "@/components/ui/badge"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { Globe, Code2, Rocket, ExternalLink, CheckCircle2, AlertTriangle, Package } from "lucide-react"; import { CodeBlock } from "@/components/dev-platform/ui/CodeBlock"; export default function SpatialIntegration() { return (
Spatial Integration

Build Spatial Experiences with AeThex

Create immersive 3D spaces for Spatial's web-based metaverse platform. Use AeThex's unified API with Spatial's visual editor, TypeScript SDK, and multi-device support (VR, Desktop, Mobile).

{/* Quick Stats */}
5M+
Monthly Visitors
100K+
Created Spaces
No Install
Browser-Based
{/* Features */}

What You Can Build

Web3 Virtual Events Host conferences, exhibitions, and networking events with AeThex authentication and NFT-gated access Cross-Device Experiences Build once, deploy everywhere - Spatial runs on Quest, desktop browsers, and mobile devices Interactive 3D Content Sync 3D models, animations, and interactive objects with AeThex backend for dynamic content updates Analytics & Engagement Track visitor behavior, space engagement metrics, and cross-platform user journeys via AeThex analytics
{/* Quick Start */}

Quick Start Guide

1. Install AeThex Spatial SDK Add AeThex scripting components to your Spatial space

In Spatial Studio, go to ScriptsAdd Package → Search for @aethex/spatial-sdk

2. Initialize AeThex in Your Space Configure API credentials in Spatial Studio { console.log(\`User \${user.username} joined\`); // Fetch user profile from AeThex aethex.users.get(user.id).then(profile => { console.log('AeThex Profile:', profile); }); }); // Example: Update player stats when they interact space.onInteract.subscribe((event) => { aethex.achievements.unlock(event.user.id, 'spatial-explorer'); });`} language="typescript" showLineNumbers={true} /> 3. Build Interactive Features Create cross-platform leaderboards and achievements { const newScore = await updateLeaderboard(event.user.id, 100); console.log('New leaderboard:', newScore); });`} language="typescript" showLineNumbers={true} />
{/* Authentication Flow */}

Player Authentication

Link Spatial visitors to AeThex Passport for cross-platform identity and progression.

OAuth Integration

Spatial supports web-based OAuth flows, making authentication seamless for browser users.

1

User Enters Space

Spatial script detects new visitor via onUserJoined event

2

Prompt Authentication

Display 3D UI panel with "Link AeThex Account" button

3

OAuth Redirect

Opens aethex.dev/oauth/spatial in browser overlay

4

Callback Webhook

Spatial receives auth token, stores in user session, unlocks cross-platform features

{ const linkedUser = await aethex.auth.verifyToken(token); console.log('User linked:', linkedUser); // Now you can access cross-platform data const achievements = await aethex.achievements.list(linkedUser.id); displayAchievements(achievements); });`} language="typescript" showLineNumbers={true} />
{/* Best Practices */}

Best Practices & Limitations

Spatial Limitations

Browser-based performance: Keep API calls under 50/minute to avoid throttling

Asset size limits: 3D models max 50MB, optimize for web delivery

Script execution: Spatial runs TypeScript in sandbox, no native code

Concurrent users: Max 50 users per space instance, scale with multiple instances

Performance Optimization

Cache API responses: Store frequently accessed data in space variables

Lazy load content: Only fetch 3D assets when user approaches interactive zones

Use CDN URLs: Host large assets on AeThex CDN for faster loading

Mobile optimization: Test on mobile devices, reduce draw calls for iOS/Android

{/* Resources */}

Resources & Examples

Example Spaces Documentation
{/* Next Steps */}

Ready to Build?

Create immersive web3 experiences with Spatial and AeThex. Deploy to browsers, VR headsets, and mobile devices with one unified API.

); }