Search Docs
Loading...
Skip to content

Vanilla JS Without UI (headless)

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#

Terminal window
npm install @cesdk/engine

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 programmatically
const scene = await engine.scene.create();
// Add blocks and manipulate content
const page = engine.block.create('page');
engine.block.setWidth(page, 800);
engine.block.setHeight(page, 600);
engine.block.appendChild(scene, page);
// Clean up
engine.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#

MethodDescription
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#