Search
Loading...
Skip to content

Configuration

Set up CE.SDK with license keys, asset base URLs, user IDs, and runtime configuration options to match your application requirements.

Configuration example showing CE.SDK editor with theme toggle in navigation bar

10 mins
estimated time
Download
StackBlitz
GitHub

CreativeEditorSDK.create() initializes the full CE.SDK editor with UI components. The configuration object controls license validation, asset loading, user tracking, and UI behavior.

Required Configuration#

The license property is the only required configuration. All other properties have sensible defaults.

PropertyTypePurpose
licensestringLicense key to remove export watermarks

The license key validates your CE.SDK subscription and removes watermarks from exports. Get a free trial license at https://img.ly/forms/free-trial.

Optional Configuration#

These properties customize engine behavior and are all optional.

Engine Properties#

PropertyTypePurpose
baseURLstringLocation of core engine assets (WASM, data files)
userIdstringUser identifier for MAU tracking
loggerfunctionCustom logging function
role'Creator' | 'Adopter' | 'Viewer' | 'Presenter'User role for feature access
featureFlagsobjectExperimental feature toggles

Editor Properties#

PropertyTypePurpose
devModebooleanEnable developer diagnostics
a11yobjectAccessibility settings
uiobjectUser interface customization

Configuration Properties#

License Key#

The license key validates your CE.SDK subscription and removes watermarks from exports. Without a valid license, exports include a watermark.

// License key removes watermarks from exports
// Get a free trial at https://img.ly/forms/free-trial
// license: 'YOUR_CESDK_LICENSE_KEY',

User ID#

Provide a unique user identifier for accurate Monthly Active User (MAU) tracking. This helps count users correctly when the same person accesses your application from multiple devices.

// User ID for accurate MAU tracking across devices
userId: 'guides-user',

Custom Logger#

Replace the default console logging with a custom logger function. The logger receives a message string and an optional log level ('Info', 'Warning', or 'Error').

// Custom logger for debugging and monitoring
logger: (message: string, level?: string) => {
console.log(`[CE.SDK ${level ?? 'Info'}] ${message}`);
},

Developer Mode#

Enable developer mode to get additional diagnostics and debugging information in the console.

// Enable developer mode for diagnostics
devMode: false,

Accessibility Settings#

Configure accessibility options like heading hierarchy for screen readers. The headingsHierarchyStart property sets which heading level (1-6) the editor should start from.

// Accessibility settings
a11y: {
headingsHierarchyStart: 1 as const
},

Asset Base URL#

The baseURL property specifies the location of core engine assets, including WASM files, data files, and JavaScript workers. By default, these load from the IMG.LY CDN. For production deployments, host these assets yourself by copying the assets folder from node_modules/@cesdk/engine/assets to your server.

Content assets like stickers and filters are loaded separately via engine.addDefaultAssetSources(), which has its own baseURL parameter defaulting to https://cdn.img.ly/assets/v4.

// Location of core engine assets (WASM, data files)
// Default: IMG.LY CDN. For production, host assets yourself.
// baseURL: 'https://your-cdn.com/cesdk-assets/',

Initialization#

Pass the configuration object to CreativeEditorSDK.create() along with a container element selector.

CreativeEditorSDK.create('#cesdk_container', config)
.then(async (cesdk: CreativeEditorSDK) => {

Runtime Configuration#

After initialization, use dedicated APIs to modify settings dynamically.

Internationalization#

Locale#

Change the UI language using cesdk.i18n.setLocale().

cesdk.i18n.setLocale('en');
const currentLocale = cesdk.i18n.getLocale();
console.log('Current locale:', currentLocale);

Translations#

Add or override UI text strings using cesdk.i18n.setTranslations().

cesdk.i18n.setTranslations({
en: {
'common.back': 'Go Back',
'common.apply': 'Apply Changes'
}
});

Theme#

Set the UI theme using cesdk.ui.setTheme(). Options: 'light', 'dark', or 'system'.

cesdk.ui.setTheme('light');
const currentTheme = cesdk.ui.getTheme();
console.log('Current theme:', currentTheme);

Actions#

Register custom actions for user interactions like save and export.

cesdk.actions.register('customSave', async () => {
const sceneBlob = await engine.scene.saveToArchive();
await cesdk.utils.downloadFile(sceneBlob, 'application/zip');
});

Built-in Actions#

CE.SDK provides built-in actions for common operations like saving, exporting, and importing. Add them to the navigation bar using insertNavigationBarOrderComponent():

// Add built-in export and import actions to the navigation bar
cesdk.ui.insertNavigationBarOrderComponent('last', {
id: 'ly.img.actions.navigationBar',
children: [
'ly.img.saveScene.navigationBar',
'ly.img.exportImage.navigationBar',
'ly.img.exportPDF.navigationBar',
'ly.img.exportScene.navigationBar',
'ly.img.exportArchive.navigationBar',
'ly.img.importScene.navigationBar',
'ly.img.importArchive.navigationBar'
]
});

Available built-in actions:

Action IDPurpose
ly.img.saveScene.navigationBarSave scene to cloud
ly.img.exportImage.navigationBarExport as image (PNG/JPEG)
ly.img.exportPDF.navigationBarExport as PDF
ly.img.exportScene.navigationBarExport scene file
ly.img.exportArchive.navigationBarExport as archive (ZIP)
ly.img.importScene.navigationBarImport scene file
ly.img.importArchive.navigationBarImport archive (ZIP)

Scale#

Adjust UI scale for different device types. Options: 'normal', 'large', or 'modern'.

cesdk.ui.setScale('modern');
const currentScale = cesdk.ui.getScale();
console.log('Current scale:', currentScale);

Engine Settings#

Configure engine behavior using engine.editor.setSetting().

engine.editor.setSetting('doubleClickToCropEnabled', true);
engine.editor.setSetting('highlightColor', { r: 0, g: 0.5, b: 1, a: 1 });
const cropEnabled = engine.editor.getSetting('doubleClickToCropEnabled');
console.log('Double-click crop enabled:', cropEnabled);

API Reference#

MethodPurpose
CreativeEditorSDK.create()Initialize editor
cesdk.ui.setTheme()Set UI theme
cesdk.i18n.setLocale()Set UI locale
cesdk.i18n.setTranslations()Add translations
cesdk.ui.setScale()Set UI scale
cesdk.actions.register()Register custom actions
cesdk.ui.insertNavigationBarOrderComponent()Add built-in actions to navigation bar
cesdk.utils.downloadFile()Download blob as file
engine.editor.setSetting()Set engine setting

Next Steps#