Search Docs
Loading...
Skip to content

Serve Assets

Configure CE.SDK to load engine assets from your own servers or local filesystem for server-side deployments using the native Node.js bindings.

The @cesdk/node-native package bundles the engine’s runtime resources — ICU data, shaders, the font fallback files, and the emoji font — directly in the npm package. No additional setup is required to initialize the engine, render text with full Unicode and emoji coverage, and use its APIs offline. There are no WASM files: the engine is a native addon.

@cesdk/node-native is offline-first: the default baseURL resolves to the package’s own assets/ directory, so the engine boots without reaching the IMG.LY CDN. You only need to configure assets when you register content asset sources (stickers, shapes, typefaces, filters, and so on) or when your scenes reference assets with relative URIs that should resolve against your own location.

For rendering-only workflows (loading existing scenes and exporting to PNG, PDF, or MP4 video), the engine loads scene-referenced assets directly from their embedded URLs.

Understanding Asset Categories#

The imgly-assets.zip archive contains directories organized by function:

Directory Contents Bundled in npm? When Needed
emoji/ Emoji assets Yes If rendering emojis
fonts/ Font fallback files Yes For Unicode coverage
ly.img.*/ Content asset sources (stickers, shapes, typefaces, filters, …) No If registering asset sources

Engine-Level Assets#

The engine uses additional assets for font fallback (Unicode character coverage) and emoji rendering. By default, these load from the assets/ directory bundled inside the @cesdk/node-native package, so they work offline without reaching the IMG.LY CDN:

  • Font fallback files — Used when text contains characters not covered by the selected font. Located at {baseURL}/fonts/font-{index}.ttf.
  • Emoji font — The default emoji font (NotoColorEmoji.ttf). Located at {baseURL}/emoji/NotoColorEmoji.ttf.

The fonts/ and emoji/ directories ship inside the package and are also included in the imgly-assets.zip download. When you self-host and point baseURL at your own location, ensure these directories are present there.

Self-Hosting Content Assets#

Download and extract the assets archive:

Terminal window
curl -O https://cdn.img.ly/packages/imgly/cesdk-engine/1.82.0/imgly-assets.zip
unzip imgly-assets.zip -d ./cesdk-assets

Using Local Filesystem#

Point baseURL at a local directory to resolve scene-relative URIs and asset sources directly from disk:

import CreativeEngine from '@cesdk/node-native';
import path from 'path';
import { pathToFileURL } from 'url';
const engine = await CreativeEngine.init({
license: 'YOUR_CESDK_LICENSE_KEY',
baseURL: pathToFileURL(path.resolve('./cesdk-assets')).href + '/',
});

Registering Default Asset Sources#

The default asset sources (typefaces, shapes, stickers, filters, …) are not bundled in the package. Register them from your self-hosted location — or from the IMG.LY CDN — by passing a baseURL to addDefaultAssetSources():

// From your self-hosted copy
await engine.addDefaultAssetSources({
baseURL: pathToFileURL(path.resolve('./cesdk-assets')).href + '/',
});
// Or from the IMG.LY CDN
await engine.addDefaultAssetSources({
baseURL: 'https://cdn.img.ly/assets/v3',
});

Sources that are missing from the provided location are skipped with a warning, so you can host only the source directories you need.

Using Your Own Server#

Any HTTP(S) location works the same way — host the extracted archive on your server or CDN and pass its URL as baseURL:

const engine = await CreativeEngine.init({
license: 'YOUR_CESDK_LICENSE_KEY',
baseURL: 'https://your-cdn.example.com/cesdk-assets/',
});

API Reference#

API Purpose
config.baseURL Base path for engine and content assets (defaults to the bundled package assets)
engine.addDefaultAssetSources() Register the default asset sources from a given baseURL
engine.addDemoAssetSources() Register demo asset sources (sample images, videos, audio)
engine.getBaseURL() Read the resolved base URL the engine is using