Installation
Add elah to your React application. The SDK is published to npm as @elah/editor — install it with your package manager and wire it into Next.js or Vite.
Requirements
Install
Install @elah/editor. The decode/export backend (mediabunny) ships bundled — there's nothing else to add:
npm install @elah/editorUsing a different package manager:
pnpm add @elah/editor
yarn add @elah/editor
bun add @elah/editorPeer Dependencies
@elah/editor only expects React to be provided by your app — mediabunny and the rest of the pipeline are pulled in transitively. A typical package.json looks like:
{
"dependencies": {
"@elah/editor": "^0.2.0",
"react": "^18 || ^19",
"react-dom": "^18 || ^19"
}
}The package ships ESM with bundled TypeScript declarations — no separate @types install required.
Next.js Setup
Add the SDK packages to transpilePackages so the bundler can resolve the export Web Worker that @elah/core spawns via new URL('./ExportWorker.js', import.meta.url):
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
// @elah/editor (+ its @elah/core / @elah/timeline deps) and mediabunny
// ship modern ESM that must be transpiled by the consuming app.
transpilePackages: ['@elah/editor', '@elah/core', '@elah/timeline', 'mediabunny'],
}
export default nextConfigThe editor touches browser-only APIs (Canvas, Web Audio, Workers), so render it client-side only with a dynamic import:
'use client'
import dynamic from 'next/dynamic'
// ssr: false keeps the editor out of the server bundle.
const Editor = dynamic(() => import('@/components/Editor'), {
ssr: false,
})
export default function Page() {
return <Editor />
}Vite Setup
Serve the SDK packages from their real files (instead of esbuild's pre-bundle) so the new URL(...) worker reference inside @elah/core resolves correctly:
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
worker: {
// @elah/core spawns the MP4 export worker as a module worker.
format: 'es',
},
optimizeDeps: {
exclude: ['@elah/editor', '@elah/core', '@elah/timeline', 'mediabunny'],
},
})Build the full editor in under 20 lines — wire your demuxer, mount Preview, and add the Timeline.
Continue to Quick Start →