Skip to content

Installation

Strata requires React Three Fiber and Three.js as peer dependencies. This guide covers installation for various package managers and project setups.

  • Node.js: 18.0 or higher
  • React: 18.0 or higher
  • Three.js: 0.150 or higher
  • React Three Fiber: 8.0 or higher
Terminal window
pnpm add @strata-game-library/core @react-three/fiber @react-three/drei three
Terminal window
npm install @strata-game-library/core @react-three/fiber @react-three/drei three
Terminal window
yarn add @strata-game-library/core @react-three/fiber @react-three/drei three
Terminal window
bun add @strata-game-library/core @react-three/fiber @react-three/drei three

Strata is written in TypeScript and includes full type definitions. For the best experience, add Three.js types:

Terminal window
pnpm add -D @types/three

If you only need the GLSL shaders (no React dependencies):

Terminal window
pnpm add @strata-game-library/shaders

For pre-configured terrain, weather, and effects:

Terminal window
pnpm add @strata-game-library/presets @strata-game-library/core

For React Native projects:

Terminal window
npm install @strata-game-library/react-native-plugin
cd ios && pod install

For Capacitor projects:

Terminal window
pnpm add @strata-game-library/capacitor-plugin
npx cap sync

Strata works with Next.js out of the box. For server-side rendering, use dynamic imports:

import dynamic from 'next/dynamic';
const StrataScene = dynamic(() => import('./StrataScene'), {
ssr: false,
loading: () => <div>Loading 3D scene...</div>
});

Strata works with Vite without additional configuration:

vite.config.ts
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [react()],
});

For CRA projects, ensure you have react-scripts 5.0+ for proper ES module support.

Create a simple test scene to verify everything is working:

import { Canvas } from '@react-three/fiber';
import { Water, ProceduralSky } from '@strata-game-library/core';
import { OrbitControls } from '@react-three/drei';
function App() {
return (
<div style={{ width: '100vw', height: '100vh' }}>
<Canvas camera={{ position: [0, 10, 20] }}>
<ProceduralSky />
<Water size={100} />
<OrbitControls />
</Canvas>
</div>
);
}
export default App;

If you see a sky and water plane, Strata is installed correctly!

If you encounter module resolution errors, ensure your tsconfig.json has:

{
"compilerOptions": {
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true
}
}

Strata requires WebGL 2.0. Check browser support at caniuse.com/webgl2.

For better performance on mobile:

<Canvas
dpr={[1, 2]} // Limit pixel ratio
performance={{ min: 0.5 }} // Allow frame dropping
>
{/* Your scene */}
</Canvas>