Automatically generate size variations of your design and easily scale your marketing materials across different platforms.

Pre-requisites#
This guide assumes basic familiarity with React and TypeScript.
- Node.js v22+ with npm – Download
- React 18+ – The starterkit uses React for component architecture
- Supported browsers – Chrome 114+, Edge 114+, Firefox 115+, Safari 15.6+
See Browser Support for the full list
Get Started#
Start fresh with a standalone Automated Resizing project. This creates a complete, ready-to-run React application that demonstrates content-aware resizing across multiple social media formats.
Step 1: Clone the Repository#
git clone https://github.com/imgly/starterkit-automated-resizing-react-web.gitgit clone https://github.com/imgly/starterkit-automated-resizing-react-web.gitnpx degit imgly/starterkit-automated-resizing-react-web starterkit-automated-resizing-react-webnpx degit imgly/starterkit-automated-resizing-react-web starterkit-automated-resizing-react-webThe src/ folder contains the React application:
src/├── app/ # Demo application├── imgly/│ ├── index.ts # Editor initialization function│ ├── demo-assets.ts # Demo asset URLs│ ├── resizing.ts # Content-aware resizing logic│ ├── sizes.ts # Default sizes│ ├── types.ts # TypeScript type definitions│ └── config/│ ├── advanced-editor/│ │ ├── plugin.ts # Main configuration plugin│ │ ├── actions.ts # Export/import actions│ │ ├── features.ts # Feature toggles│ │ ├── i18n.ts # Translations│ │ ├── settings.ts # Engine settings│ │ ├── keyboard/ # Keyboard shortcuts│ │ │ ├── keyboard.ts # Shortcut registration│ │ │ └── catalogs/│ │ │ └── us-ansi.ts # Key catalog│ │ └── ui/ # UI customization│ │ ├── index.ts # Combines UI customization exports│ │ ├── canvas.ts # Canvas configuration│ │ ├── components.ts # Custom component registration│ │ ├── dock.ts # Dock layout configuration│ │ ├── inspectorBar.ts # Inspector bar layout│ │ ├── navigationBar.ts # Navigation bar layout│ │ ├── panel.ts # Panel configuration│ │ └── videoTimeline.ts # Timeline configuration│ └── design-editor/ # Same structure as advanced-editor/└── index.tsx # Application entry pointStep 2: Install Dependencies#
Install the required packages:
cd starterkit-automated-resizing-react-web
npm installcd starterkit-automated-resizing-react-web
npm installcd starterkit-automated-resizing-react-web
pnpm installcd starterkit-automated-resizing-react-web
pnpm installcd starterkit-automated-resizing-react-web
yarncd starterkit-automated-resizing-react-web
yarnStep 3: Download Assets#
CE.SDK requires engine assets (fonts, icons, UI elements) to function. For production, serve them as static files from your project’s public/ directory.
curl -O https://cdn.img.ly/packages/imgly/cesdk-js/1.87.0-rc.3/imgly-assets.zip
unzip imgly-assets.zip -d public/
rm imgly-assets.zipcurl -O https://cdn.img.ly/packages/imgly/cesdk-js/1.87.0-rc.3/imgly-assets.zip
unzip imgly-assets.zip -d public/
rm imgly-assets.zipWithout further setup, the editor loads these assets from the IMG.LY CDN, which is for development only. To use the downloaded copy, set baseURL: '/assets' in the editor configuration in src/index.tsx. To add your license key, add one of the two license lines below to the same object, without the leading //. Option 1 puts the key in the code. Option 2 reads VITE_CESDK_LICENSE from a .env file, which you create as a copy of .env.example. Without a license key, the editor runs in evaluation mode and adds a watermark to exports.
const config = { // ... baseURL: '/assets', // license: 'YOUR_CESDK_LICENSE_KEY' // Option 1: the key in the code // license: import.meta.env.VITE_CESDK_LICENSE // Option 2: the key from .env // ...};Step 4: Run the Development Server#
npm run devnpm run devpnpm run devpnpm run devyarn devyarn devOpen http://localhost:5173 in your browser.
Get Started#
Integrate the Automated Resizing functionality into an existing React application. This adds the resizing configuration and components to your current project structure.
Step 1: Clone#
cd your-projectcd your-projectClone the starter kit and copy the editor configuration to your project:
git clone https://github.com/imgly/starterkit-automated-resizing-react-web.git
cp -r starterkit-automated-resizing-react-web/src/imgly ./src/imgly
rm -rf starterkit-automated-resizing-react-webgit clone https://github.com/imgly/starterkit-automated-resizing-react-web.git
cp -r starterkit-automated-resizing-react-web/src/imgly ./src/imgly
rm -rf starterkit-automated-resizing-react-webnpx degit imgly/starterkit-automated-resizing-react-web/src/imgly ./src/imglynpx degit imgly/starterkit-automated-resizing-react-web/src/imgly ./src/imglyThe imgly/ folder contains the resizing configuration:
imgly/├── index.ts # Editor initialization function├── demo-assets.ts # Demo asset URLs├── resizing.ts # Content-aware resizing logic├── sizes.ts # Default sizes├── types.ts # TypeScript type definitions└── config/ ├── advanced-editor/ │ ├── plugin.ts # Main configuration plugin │ ├── actions.ts # Export/import actions │ ├── features.ts # Feature toggles │ ├── i18n.ts # Translations │ ├── settings.ts # Engine settings │ ├── keyboard/ # Keyboard shortcuts │ │ ├── keyboard.ts # Shortcut registration │ │ └── catalogs/ │ │ └── us-ansi.ts # Key catalog │ └── ui/ # UI customization │ ├── index.ts # Combines UI customization exports │ ├── canvas.ts # Canvas configuration │ ├── components.ts # Custom component registration │ ├── dock.ts # Dock layout configuration │ ├── inspectorBar.ts # Inspector bar layout │ ├── navigationBar.ts # Navigation bar layout │ ├── panel.ts # Panel configuration │ └── videoTimeline.ts # Timeline configuration └── design-editor/ # Same structure as advanced-editor/Step 2: Install Dependencies#
Install the Creative Editor SDK:
npm install @cesdk/cesdk-js@1.87.0-rc.3npm install @cesdk/cesdk-js@1.87.0-rc.3pnpm add @cesdk/cesdk-js@1.87.0-rc.3pnpm add @cesdk/cesdk-js@1.87.0-rc.3yarn add @cesdk/cesdk-js@1.87.0-rc.3yarn add @cesdk/cesdk-js@1.87.0-rc.3Headless Engine#
The starter kit boots a headless CreativeEngine for variant generation. Install the engine package alongside the editor:
npm install @cesdk/engine@1.87.0-rc.3npm install @cesdk/engine@1.87.0-rc.3pnpm add @cesdk/engine@1.87.0-rc.3pnpm add @cesdk/engine@1.87.0-rc.3yarn add @cesdk/engine@1.87.0-rc.3yarn add @cesdk/engine@1.87.0-rc.3Step 3: Download Assets#
CE.SDK requires engine assets (fonts, icons, UI elements) to function. These must be served as static files from your project’s public/ directory.
curl -O https://cdn.img.ly/packages/imgly/cesdk-js/1.87.0-rc.3/imgly-assets.zip
unzip imgly-assets.zip -d public/
rm imgly-assets.zipcurl -O https://cdn.img.ly/packages/imgly/cesdk-js/1.87.0-rc.3/imgly-assets.zip
unzip imgly-assets.zip -d public/
rm imgly-assets.zipStep 4: Add a Container Element#
Add a container element to your HTML where the editor will be mounted:
<div id="cesdk_container" style="width: 100%; height: 100vh;"></div>Step 5: Initialize the Editor#
Choose your editing mode and initialize the editor accordingly:
import CreativeEditorSDK from '@cesdk/cesdk-js';
import { initAutomatedResizingDesignEditor } from './imgly';
const config = { userId: 'your-user-id', baseURL: '/assets' // license: 'YOUR_LICENSE_KEY',};
CreativeEditorSDK.create('#cesdk_container', config) .then(async (cesdk) => { await initAutomatedResizingDesignEditor(cesdk); await cesdk.actions.run('scene.create'); }) .catch((error) => { console.error('Failed to initialize CE.SDK:', error); });import CreativeEditorSDK from '@cesdk/cesdk-js';
import { initAutomatedResizingAdvancedEditor } from './imgly';
const config = { userId: 'your-user-id', baseURL: '/assets' // license: 'YOUR_LICENSE_KEY',};
CreativeEditorSDK.create('#cesdk_container', config) .then(async (cesdk) => { await initAutomatedResizingAdvancedEditor(cesdk); }) .catch((error) => { console.error('Failed to initialize CE.SDK:', error); });Auto Resize#
The starterkit provides the resize function for content-aware resizing:
import { resize, DEFAULT_SIZES } from './imgly';DEFAULT_SIZES contains preset dimensions for common social media formats (Instagram Story, Instagram Post 4:5, X Post, Facebook Post). Each size follows this structure:
{ id: 'ig-story', label: 'Instagram Story', width: 1080, height: 1920, designUnit: 'Pixel', platform: 'instagram'}resize#
Generate resized variants for all specified sizes. Returns blobs—the caller handles URL creation and cleanup:
const variants = await resize({ engine: cesdk.engine, sizes: DEFAULT_SIZES, scene: templateSceneString, exportOptions: { mimeType: 'image/png' }, onProgress: (completed, total, variant) => { // Create URL for rendering const url = URL.createObjectURL(variant.blob); console.log(`Generated ${completed}/${total}: ${variant.size.label}`); }});The exportOptions parameter accepts CE.SDK’s ExportOptions type, supporting formats like image/png, image/jpeg, image/webp, and quality settings.
Customize Assets#
The editor uses asset source plugins to provide built-in libraries for templates, stickers, shapes, and fonts. Customize what’s included based on your needs.
Asset sources are added via plugins in src/imgly/index.ts. Enable or disable individual sources:
import { FiltersAssetSource, StickerAssetSource, TextAssetSource, VectorShapeAssetSource, EffectsAssetSource, DemoAssetSources, // ...} from '@cesdk/cesdk-js/plugins';
// Add only the sources you needawait cesdk.addPlugin(new FiltersAssetSource());await cesdk.addPlugin(new StickerAssetSource());await cesdk.addPlugin(new TextAssetSource());await cesdk.addPlugin(new VectorShapeAssetSource());await cesdk.addPlugin(new EffectsAssetSource());
// Demo assets include social media templatesawait cesdk.addPlugin( new DemoAssetSources({ include: [ 'ly.img.templates.blank.*', 'ly.img.templates.social.*', 'ly.img.image.*' ] }));For production deployments, self-hosting assets is required—the IMG.LY CDN is intended for development only. See Serve Assets for downloading assets, configuring baseURL, and excluding unused sources to optimize load times.
Customize (Optional)#
Theming#
CE.SDK supports light and dark themes out of the box, plus automatic system preference detection. Switch between themes programmatically:
// 'light' | 'dark' | 'system' | (() => 'light' | 'dark')cesdk.ui.setTheme('dark');See Theming for custom color schemes, CSS variables, and advanced styling options.
Localization#
Customize UI labels and add support for multiple languages. The i18n system supports translation keys for all UI elements:
// Override specific labelscesdk.i18n.setTranslations({ en: { 'component.fileOperation.exportImage': 'Download Design', 'libraries.ly.img.image.label': 'Photos', 'common.done': 'Finish' }});
// Set the active localecesdk.i18n.setLocale('de');See Localization for supported languages, translation key reference, and right-to-left language support.
UI Layout#

Customize the editor interface by modifying the dock, inspector bar, navigation bar, and canvas menu. CE.SDK provides Order APIs to control which components appear and in what sequence.
// Read the current navigation bar componentsconst navOrder = cesdk.ui.getComponentOrder({ in: 'ly.img.navigation.bar' });
// Add the built-in Share button after the titlecesdk.ui.insertOrderComponent( { in: 'ly.img.navigation.bar', after: 'ly.img.title.navigationBar' }, { id: 'ly.img.shareScene.navigationBar', onClick: async () => { const scene = await cesdk.engine.scene.saveToString(); console.log('Share the scene', scene.length); } });// Add a dock button that opens the image librarycesdk.ui.insertOrderComponent( { in: 'ly.img.dock', position: 'end' }, { id: 'ly.img.assetLibrary.dock', key: 'my-images', icon: '@imgly/Image', label: 'My Images', entries: ['ly.img.image'] });See Dock, Inspector Bar, Navigation Bar, Canvas Menu, and Canvas for detailed layout customization options.
Settings & Features#
Fine-tune editor behavior through settings and features.
Settings configure core engine behavior—rendering, input handling, and page display:
engine.editor.setSetting('page/dimOutOfPageAreas', true);engine.editor.setSetting('mouse/enableZoom', true);engine.editor.setSetting('doubleClickToCropEnabled', true);Features toggle which editing tools and panels appear in the UI:
// Switch editor features oncesdk.features.configure({ 'ly.img.crop': { enabled: true }, 'ly.img.filter': { enabled: true }, 'ly.img.adjustment': { enabled: true }});See Settings and Features for the complete reference.
Key Capabilities#
The Automated Resizing starter kit includes everything needed for multi-format content generation.
Content-Aware Resizing
Intelligently resize designs while maintaining visual balance and element positioning.
Multi-Platform Output
Generate variants for Instagram, Facebook, X, LinkedIn, YouTube, and custom sizes in one click.
Editable Results
Fine-tune any generated variant with the full editor—adjust layouts, text, and imagery.
Template System
Start from pre-designed templates or create custom designs as your resizing source.
React Integration
Built with React 18+ using custom hooks for clean state management and component architecture.
Export Options
Export to multiple formats including PNG, JPEG, and PDF with quality and size controls.
Troubleshooting#
Editor doesn’t load#
- Check the container element exists: Ensure your container element is in the DOM before calling
create() - Verify the baseURL: Assets must be accessible from the CDN or your self-hosted location
- Check console errors: Look for CORS or network errors in browser developer tools
Assets don’t appear#
- Check network requests: Open DevTools Network tab and look for failed requests to
cdn.img.ly - Self-host assets for production: See Serve Assets to host assets on your infrastructure
Export fails or produces blank images#
- Wait for content to load: Ensure images are fully loaded before exporting
- Check CORS on images: Remote images must allow cross-origin access
Watermark appears in production#
- Add your license key: Set the
licenseproperty in your configuration - Get a license: Contact us at img.ly/forms/contact-sales/
Next Steps#
- Configuration – Complete list of initialization options
- Serve Assets – Self-host engine assets for production
- Actions – Build custom export and save workflows
- Theming – Customize colors and appearance
- Localization – Add translations and language support