Installation
Veyrajs ships as scoped packages under @veyrajs/*. The engine (@veyrajs/core) stands alone;
each framework adapter is a thin, optional package on top of it.
The engine only
Section titled “The engine only”@veyrajs/core has zero runtime dependencies — use it imperatively in any project (vanilla TS,
a Web Component, a Worker-driven canvas, or a framework you wire up yourself).
npm install @veyrajs/corepnpm add @veyrajs/coreyarn add @veyrajs/coreWith a framework adapter
Section titled “With a framework adapter”Install the adapter for your framework alongside the core. The framework itself is a peer dependency — you provide it; the adapter never bundles its own copy.
| Adapter | Package | Peer dependency |
|---|---|---|
| React | @veyrajs/react |
react >= 18, react-dom >= 18 |
| Vue 3 | @veyrajs/vue |
vue ^3.4 |
| Svelte 5 | @veyrajs/svelte |
svelte ^5 |
| Angular 18 | @veyrajs/angular |
@angular/core ^18, @angular/common ^18 |
For example, the React adapter:
npm install @veyrajs/core @veyrajs/reactpnpm add @veyrajs/core @veyrajs/reactyarn add @veyrajs/core @veyrajs/reactYou only ever install one adapter — they are parallel siblings, never combined.
Importing
Section titled “Importing”Everything is a named export; there is no default export and no side-effecting global.
// Engineimport { Stage, Layer, Rect, Circle, History, SelectionController } from '@veyrajs/core'
// React adapterimport { ACStage, ACLayer, ACRect } from '@veyrajs/react'The packages are ESM-only and ship their own .d.ts types — no @types/* package required.
TypeScript
Section titled “TypeScript”No configuration is needed beyond a modern moduleResolution. Veyrajs is authored in strict
TypeScript and every public symbol is fully typed (config objects, events, commands, serialized
nodes). Recommended tsconfig.json essentials:
{ "compilerOptions": { "module": "ESNext", "moduleResolution": "Bundler", // or "NodeNext" "strict": true, "lib": ["ES2022", "DOM", "DOM.Iterable"] }}Requirements
Section titled “Requirements”- Node.js ≥ 20 for tooling/SSR; the engine itself runs in any modern browser.
- A browser with Canvas 2D and Pointer Events (every evergreen browser).
- pnpm 10 only if you work inside the Veyrajs monorepo (via Corepack:
corepack enable).
Next: build your first scene →