layermetry SDK
Welcome to the Next.js integration documentation for@layermetry/media-editor.
Overview
The@layermetry/media-editor SDK provides powerful image and video editing capabilities for React applications. This documentation covers everything you need to integrate the SDK into your Next.js project.
Documentation Files
Integration Guides
-
Next.js ImageEditor Integration
- Complete guide for ImageEditor integration
- Interface documentation and prop reference
- Theme customization examples
- Step-by-step implementation
- Callback handling and export options
-
Next.js VideoEditor Integration
- Complete guide for VideoEditor integration
- WASM setup instructions (critical!)
- Video processing workflow
- Performance considerations
- Export and encoding options
Troubleshooting
- FAQ
- Common issues and solutions
- React version compatibility problems
- License validation errors
- WASM loading failures
- Build and deployment issues
- Quick troubleshooting checklist
Quick Start
1. Install Dependencies
2. Configure Next.js
next.config.js:3. Import SDK Styles
app/globals.css:4. Use Dynamic Imports
5. Copy WASM Files (Video Only)
Key Concepts
Which React version?
Version 2 works in React 18 and React 19. It also works with no React at all — the editor ships as a browser custom element, so Vue, Angular, Svelte and plain HTML all run the same bundle. If you pinnedreact@18.2.0 for version 1, remove the pin.
Why Dynamic Imports?
The SDK uses browser-only APIs (Canvas, WebAssembly, Web Workers) that don’t exist during server-side rendering. Dynamic imports withssr: false ensure the SDK only loads in the browser.
Why WASM Files?
VideoEditor uses FFmpeg (compiled to WebAssembly) for video processing. These WASM modules (33MB total) must be in yourpublic/ folder so the browser can load them at runtime.
Theme System
Both editors support extensive theming through thetheme prop. You can customize:
- Background colors (primary, secondary, tertiary)
- Text colors (primary, secondary)
- Accent colors (primary, secondary, hover)
- Border colors
- Component-specific colors (buttons, inputs, toolbar, canvas, etc.)
Architecture
Common Patterns
File Upload with Preview
Export and Download
Custom Theme
Example Project
A complete working example is available in the SDK package atexamples/nextjs/.
This includes:
- Landing page with studio selection
- Image Studio with drag-and-drop
- Video Studio with export modal
- Custom branded theme implementation
- Proper file handling and state management
API Reference
ImageEditor Props
VideoEditor Props
Performance Tips
Image Editor
- ✅ Fast load time (~500ms)
- ✅ Works on mobile devices
- ✅ Low memory usage (less than 100MB)
- ✅ Instant export
Video Editor
- ⚠️ Longer load time (~2s) due to WASM
- ⚠️ Desktop only (mobile not supported)
- ⚠️ High memory usage (500MB+ for HD video)
- ⚠️ Slow export (1-2 minutes for 30s 1080p video)
- Show loading indicators during export
- Warn users about processing time
- Recommend shorter clips or lower resolution
- Consider server-side processing for production apps
Version Compatibility
Version 2 no longer brings its own copy of React, so the host framework version
no longer constrains the SDK. The same bundle also runs with no React installed
at all.
Support
Documentation
- Integration Guides: This folder
- API Docs: Coming soon
- Video Tutorials: Coming soon
Getting Help
- 📧 Email: support@layermetry.com
- 💬 Support Portal: Contact your account manager
- 📚 Docs: https://docs.layermetry.com
Reporting Bugs
Please include:- Next.js version
- React version
- SDK version
- Error messages
- Steps to reproduce
- Browser/OS information
License
@layermetry/media-editor is commercial software. See the terms of use for the licence terms.
Changelog
v2.0.0 (Current)
- Published as
@layermetry/media-editor. The old@distralabsname is retired. - Works in React 18 and React 19, in Vue, Angular, Svelte, Next.js and plain HTML — the editor ships as a browser custom element, so the host framework no longer matters.
- One package instead of 162.
ffmpegremoved: 31 MB of WebAssembly is now 0. Export uses the browser’s own video hardware.- A faster export path, measured at 4.4 times the previous exporter. Opt in with
export={{ experimental: true }}.
v1.1.9
- Next.js 14 compatibility
- React 18.2 support
- Theme customization
- Video timeline improvements
- Bug fixes
Ready to get started? Choose your integration guide: Having issues?

