In this example, we explain how to configure the Creative Engine to use assets hosted on your own servers. While we serve all assets from our own CDN by default, it is highly recommended to serve the assets from your own servers in a production environment.
1. Register IMG.LY’s default assets#
Register each default asset source by pointing engine.asset.addLocalAssetSourceFromJSON at its content.json manifest. Define a single baseURL and reuse it for every source. In this example it points at the IMG.LY CDN; the steps below show how to serve the assets from your own location instead:
let engine = Engine()
let baseURL = URL(string: "https://cdn.img.ly/packages/imgly/cesdk-swift/1.77.1/assets")!let sourceIDs = [ "ly.img.sticker", "ly.img.vector.shape", "ly.img.filter", "ly.img.color.palette", "ly.img.effect", "ly.img.blur", "ly.img.typeface", "ly.img.crop.presets", "ly.img.page.presets", "ly.img.text", "ly.img.text.styles", "ly.img.text.curves", "ly.img.text.components", "ly.img.caption.presets",]Task { for id in sourceIDs { _ = try await engine.asset.addLocalAssetSourceFromJSON( baseURL.appendingPathComponent(id).appendingPathComponent("content.json") ) }}Loading from the IMG.LY CDN is convenient while bootstrapping, but every production app should serve the assets from its own bundle or servers so it doesn’t depend on the IMG.LY CDN at runtime.
The current default sources are:
ly.img.sticker- Various stickers.ly.img.vector.shape- Shapes and arrows.ly.img.filter- LUT and duotone color effects.ly.img.color.palette- Default color palette.ly.img.effect- Default effects.ly.img.blur- Default blurs.ly.img.typeface- Default typefaces.ly.img.crop.presets- Default crop presets.ly.img.page.presets- Default page resize presets.ly.img.text- Basic text presets (title, headline, body).ly.img.text.styles- Decorative text styles.ly.img.text.curves- Curved text presets.ly.img.text.components- Text design component library.ly.img.caption.presets- Caption style presets (for video captions).
In this example, baseURL points at the IMG.LY CDN for convenience. addLocalAssetSourceFromJSON(contentURL:) resolves the base path from the URL you pass it, so production apps should point baseURL at their own bundle or servers. Follow the steps below to copy the assets and point baseURL at your own location.
2. Copy Assets#
Download the IMG.LY default assets from our CDN.
Copy the IMGLYEngine default asset folders to your application bundle. The default asset folders should be located in a new .bundle folder. It will create a nested Bundle object that can be loaded by your app. The folder structure should look like this:

3. Configure the IMGLYEngine to use your self-hosted assets#
After step 2 your app target contains IMGLYAssets.bundle. Point baseURL at it so the assets load from your app instead of the IMG.LY CDN:
let baseURL = Bundle.main.url(forResource: "IMGLYAssets", withExtension: "bundle")!To self-host on your own CDN instead, point baseURL at your domain:
let baseURL = URL(string: "https://cdn.your.custom.domain/assets")!4. Configure Engine-Level Assets#
The engine uses additional assets for font fallback (Unicode character coverage) and emoji rendering. By default, these are loaded from https://cdn.img.ly/assets/v4. When you configure the basePath setting, font fallback files and the emoji font are automatically loaded from that location:
try engine.editor.setSettingString(key: "basePath", value: "https://cdn.your.custom.domain/cesdk-assets")This setting affects:
- Font fallback files — Used when text contains characters not covered by the selected font. Located at
{basePath}/fonts/font-{index}.ttf. - Emoji font — The default emoji font (NotoColorEmoji.ttf). Located at
{basePath}/emoji/NotoColorEmoji.ttf.
To self-host these assets:
- The
fonts/andemoji/directories are already included in theimgly-assets.zipdownload - After extracting, set
basePathto point to your extraction location
For bundled assets:
let assetBundleURL = Bundle.main.url(forResource: "CESDKAssets", withExtension: "bundle")!try engine.editor.setSettingString(key: "basePath", value: assetBundleURL.absoluteString)