Variable needleConst

needle: IContext = ...

Quick access to the current Needle Engine context from anywhere — no need to pass ctx around. Use it in React/Svelte/Vue components, button handlers, or plain JavaScript.

Safe to import at module level, including in SSR environments. For pages with multiple <needle-engine> elements, use ctx directly instead.

import { needle } from "@needle-tools/engine";
button.onclick = () => {
needle.sceneData.Camera.OrbitControls.autoRotate = true;
};