@amaspace-editor/editor-3d
v0.2.22
Published
Amaspace 3D editor SDK — React + react-three-fiber components for 3D product visualization, customization and AR.
Readme
@amaspace-editor/editor-3d
Amaspace 3D editor SDK — React + react-three-fiber components for 3D product visualization, customization and AR.
Install
npm i @amaspace-editor/editor-3dRequires React 18 (peer dependency). The SDK ships its own three.js / @react-three/fiber 8 stack as hard dependencies — hosts on React 19 / R3F 9 cannot share a React tree with it and should embed it in an isolated runtime (see the widget pattern in tornado-customizer).
Usage
import { AMAMode, EditorConstructor } from '@amaspace-editor/editor-3d'
import '@amaspace-editor/editor-3d/dist/style.css'
<EditorConstructor
type="scene"
assetId={productId}
apiKey={AMASPACE_API_KEY}
presetConfig={{
mode: AMAMode.VIEWER,
applyProductRules: true,
grid: false,
startAnimation: false,
baseURL: AMASPACE_BASE_URL,
// Opt-in demand rendering (>=0.2.16): renders only when the scene
// changes instead of continuously.
frameloop: 'demand',
}}
/>AMAMode.VIEWER renders the read-only configurator; AMAMode.EDITOR enables
the full editing UI. Alongside the constructor the package exports the scene
stores (useSelectorsStore, …), hooks, actions and utils — see lib/editor-3d.ts
for the full surface.
Development
npm run build # vite build --config vite-config.js → dist/