Skip to main content

Basic Configuration Settings of CreativeEditor SDK

In this example, we will show you how to configure the CreativeEditor SDK.

Explore a full code sample of the integration on CodeSandbox or view the code on GitHub.

Basic Configuration#

The CE.SDK comes with a set of basic configuration parameters that let's you influence its look & feel.


JavaScript
let config = {
baseURL: 'https://cdn.img.ly/packages/imgly/cesdk-js/1.0.0/assets',
locale: 'en', // 'de'
theme: 'dark', // 'light'
role: 'Creator', // 'Adopter' 'Viewer'
initialScene: '' // A scene string
};
  • baseURL: string defines the root for all assets that are used by the CE.SDK. It defaults to our CDN, but should be changed in production environments. See Serving Assets for an in-depth explanation of how to serve assets from your own servers.
JavaScript
baseURL: 'https://cdn.img.ly/packages/imgly/cesdk-js/1.0.0/assets',
  • locale: string defines the current language in the user interface. The CE.SDK is shipped with locales for English (en) and German (de), but any other language is possible. See Internationalization for an in-depth explaination of how to add new languages or modify the predefined translations.
JavaScript
locale: 'en', // 'de'
  • theme: string sets the active theme. The CE.SDK includes predefined dark or light themes but is also highly customizable to match any style. See Theming for an in-depth explanation of how to create your own theme.
JavaScript
theme: 'dark', // 'light'
  • role: string sets the active role to either 'Creator', 'Adopter', 'Viewer', or 'Presenter'. See Understanding Roles for an in-depth introduction to the concept of roles in the editor and how to use them properly.
JavaScript
role: 'Creator', // 'Adopter' 'Viewer'
  • initialScene: string sets a scene description that will be loaded on startup. See Load A Scene for more details on scene loading.
JavaScript
initialScene: '' // A scene string
import 'https://cdn.img.ly/packages/imgly/cesdk-js/1.0.0/cesdk.umd.js';
let config = {
baseURL: 'https://cdn.img.ly/packages/imgly/cesdk-js/1.0.0/assets',
locale: 'en', // 'de'
theme: 'dark', // 'light'
role: 'Creator', // 'Adopter' 'Viewer'
initialScene: '' // A scene string
};
CreativeEditorSDK.init('#cesdk_container', config).then((instance) => {
/** do something with the instance of CreativeEditor SDK **/
});