Media Editor SDK
Welcome to the Next.js integration documentation for@distralabs/media-editor.
Overview
The@distralabs/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
-
NEXTJS_IMAGEEDITOR_INTEGRATION.md
- Complete guide for ImageEditor integration
- Interface documentation and prop reference
- Theme customization examples
- Step-by-step implementation
- Callback handling and export options
-
NEXTJS_VIDEOEDITOR_INTEGRATION.md
- Complete guide for VideoEditor integration
- WASM setup instructions (critical!)
- Video processing workflow
- Performance considerations
- Export and encoding options
Troubleshooting
- FAQ.md
- 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
Why React 18.2.0?
The SDK is built with React 18.2.0, which is not compatible with React 19. Next.js 15+ requires React 19, so you must use Next.js 14.2.15 with React 18.2.0.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
| Prop | Type | Required | Description |
|---|---|---|---|
licenseKey | string | ✅ | JWT license key |
onClose | () => void | ✅ | Close callback |
apiUrl | string | ❌ | API endpoint override |
files | File | ❌ | Initial image file |
callback | (result, extras?) => void | ❌ | Export callback |
theme | Record<string, string> | ❌ | Custom theme |
showThemeCreator | boolean | ❌ | Show theme UI |
VideoEditor Props
| Prop | Type | Required | Description |
|---|---|---|---|
licenseKey | string | ✅ | JWT license key |
onClose | () => void | ✅ | Close callback |
apiUrl | string | ❌ | API endpoint override |
defaultVideo | File | ❌ | Initial video file |
onExport | (result) => void | ❌ | Export callback |
theme | Record<string, string> | ❌ | Custom theme |
showThemeCreator | boolean | ❌ | Show theme UI |
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
| Next.js | React | SDK | Status |
|---|---|---|---|
| 15.x | 19.x | 1.1.9 | ❌ Not Compatible |
| 14.2.x | 18.2 | 1.1.9 | ✅ Recommended |
| 14.0.x | 18.2 | 1.1.9 | ✅ Compatible |
| 13.x | 18.2 | 1.1.9 | ⚠️ Not Tested |
Support
Documentation
- Integration Guides: This folder
- API Docs: Coming soon
- Video Tutorials: Coming soon
Getting Help
- 📧 Email: [email protected]
- 💬 Support Portal: Contact your account manager
- 📚 Docs: https://docs.distralabs.com
Reporting Bugs
Please include:- Next.js version
- React version
- SDK version
- Error messages
- Steps to reproduce
- Browser/OS information
License
The@distralabs/media-editor SDK is commercial software. See EULA.md for license terms.
Changelog
v1.1.9 (Current)
- 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?