This guide shows you how to use CE.SDK’s headless engine for programmatic content creation without a UI. You’ll install the engine, initialize it, and create content through code. By the end, you’ll be able to generate images and videos programmatically.
Install CE.SDK Engine#
npm install @cesdk/enginepnpm add @cesdk/engineyarn add @cesdk/engineimport CreativeEngine from 'https://cdn.img.ly/packages/imgly/cesdk-engine/1.69.0/index.js';Initialize the Engine#
Initialize the engine and create content programmatically:
const config = { license: 'YOUR_CESDK_LICENSE_KEY', userId: 'your-user-id'};
const engine = await CreativeEngine.init(config);
// Create a scene programmaticallyconst scene = await engine.scene.create();
// Add blocks and manipulate contentconst page = engine.block.create('page');engine.block.setWidth(page, 800);engine.block.setHeight(page, 600);engine.block.appendChild(scene, page);
// Clean upengine.dispose();Key Features#
The headless engine provides full access to CE.SDK’s capabilities without rendering a UI:
- Programmatic Scene Creation - Build designs entirely through code
- Server-Side Rendering - Generate images and videos on the server
- Batch Processing - Automate content generation at scale
- Asset Management - Load and manipulate images, videos, and fonts
- Export Capabilities - Export to PNG, JPEG, PDF, MP4, and more
API Reference#
| Method | Description |
|---|---|
CreativeEngine.init() | Initializes the headless engine for programmatic creation |
engine.scene.create() | Creates a new scene programmatically |
engine.block.create() | Creates a new block of the specified type |
engine.block.setWidth() | Sets the width of a block |
engine.block.setHeight() | Sets the height of a block |
engine.block.appendChild() | Adds a block as a child of another block |
engine.dispose() | Cleans up engine resources and releases memory |
Next Steps#
- Engine Quickstart - Learn more about programmatic content creation
- Block API Guide - Understand blocks and the scene hierarchy
- Export Guide - Learn about export formats and configuration