Skip to main content

Configure SDK to use Assets served from your own Servers

Learn how to serve assets from your own servers in CreativeEditor SDK.

In this example, we explain how to serve assets from your own servers. While we serve all assets from our own CDN, it is highly recommended to serve the assets from your own servers in a production environment

Prerequisites#

1. Add SDK to Your Project#

npm install --save cesdk/cesdk-js@~1.0.0

2. Copy Assets#

Copy the CreativeEditor SDK asset folder to your applications' asset folder. The name of the folder depends on your framework, but it's typically a folder called assets or public in the project root.

bash
cp -r ./node_modules/cesdk/cesdk-js/assets public/cesdk

Configure the Asset directory#

Next, we need to configure the SDK to use our local assets instead of the ones served via our CDN. Therefore, we add the assetPath property to the SDK configuration.

JavaScript
const config = {
...
baseURL: `./${PUBLIC_URL}/cesdk`, // ./assets/cesdk or './public/cesdk'
...
};