This guide walks you through integrating the CreativeEditor SDK (CE.SDK)
Engine with the native engine of @cesdk/node using Bun as the package
manager and runtime. By the end of this guide, you’ll have a working script
that loads a scene, modifies it, and exports it as an image using
Bun’s fast runtime.
What’s CreativeEditor SDK?#
CreativeEditor SDK (CE.SDK) lets you integrate a customizable image and video editor into your web app. It includes filters, text overlays, and other media editing tools, and adapts easily to your use case.
CreativeEditor SDK is a commercial product. To use it, you need a valid license key. If you don’t have one yet, contact our sales team or purchase a license.
Contact Sales
Purchase License
Who Is This Guide For?#
This guide is for developers who:
- Need to perform image, design, and video processing programmatically with native C++ performance using Bun.
- Want to use the native engine of CE.SDK’s Node.js package for automation or backend processing with a fast, modern runtime.
What You’ll Achieve#
- Install
@cesdk/nodewith Bun and run CE.SDK Engine on the native engine. - Load and manipulate design scenes programmatically.
- Export designs as PNG images without requiring a UI.
Prerequisites#
Before getting started, ensure you have:
- Bun installed (Download Bun).
- A valid CE.SDK license key (Request a license).
- A platform that the native engine supports: macOS (Apple Silicon or Intel), Linux (x64 or ARM64, glibc 2.39 or later) or Windows (x64, Windows 10 or Windows Server 2016). On other hosts,
@cesdk/nodestarts the WASM engine. - On Windows, the native engine renders on the GPU through Direct3D 12. Windows 10, 11 and Windows Server 2025 with Desktop Experience use Media Foundation for video and need no install; Windows N editions need the Media Feature Pack. On Server Core, in a Server Core or Nano Server container, or on a Windows Server older than 2025, install the GStreamer MSVC x86_64 runtime (1.24 or later) for video.
- On Linux, install the system packages listed under Linux runtime dependencies in the package README. The native engine links GStreamer, so it needs them also for images.
Step 1: Set Up Your Project#
Initialize your project with Bun, selecting “Blank” for the template:
bun init my-cesdk-bun-projectYour project structure should look like this:
/my-cesdk-bun-project ├── node_modules ├── .gitignore ├── bun.lock ├── index.ts ├── package.json ├── README.md └── tsconfig.jsonStep 2: Install CE.SDK for Node.js Using Bun#
Navigate into your project folder and install the package:
# Install the CE.SDK Node.js package with Bunbun add @cesdk/node@1.87.0-rc.3index.ts (TypeScript with Bun)#
Modify your index.ts file to initialize CE.SDK Engine and process a scene using Bun:
import { writeFile } from 'fs/promises';import CreativeEngine from '@cesdk/node';
// Configuration for the engineconst config = { license: 'YOUR_CESDK_LICENSE_KEY', // Replace with your CE.SDK license key};
// Initialize CE.SDK EngineCreativeEngine.init(config).then(async engine => { console.log('CE.SDK Engine initialized');
try { // Load a scene from a URL await engine.scene.load( 'https://cdn.img.ly/assets/demo/v3/ly.img.template/templates/cesdk_instagram_photo_1.scene', );
// Find the first page in the scene const [page] = engine.block.findByType('page');
// Export the scene as a PNG image const blob = await engine.block.export(page, { mimeType: 'image/png', }); const arrayBuffer = await blob.arrayBuffer();
// Save the exported image to the file system await writeFile('./example-output.png', Buffer.from(arrayBuffer));
console.log('Export completed: example-output.png'); } catch (error) { console.error('Error processing scene:', error); } finally { // Dispose of the engine to free resources engine.dispose(); }});Step 3: Run the Script Using Bun#
Once everything is set up, run your script using:
bun run index.tsThis processes the scene and generates an image file named example-output.png in your project directory.
Troubleshooting & Common Errors#
❌ Error: Invalid license key
- Verify that your license key is correct and not expired.
❌ Error: Cannot find module '@cesdk/node'
- Ensure that @cesdk/node is installed correctly using
bun add @cesdk/node@1.87.0-rc.3.
❌ Error: Failed to load the native addon of @cesdk/node for ...
CreativeEngine.initthrows this error withengine: 'native'when the native engine cannot start. With the defaultengine: 'auto', the WASM engine starts instead.- Ensure you’re on a platform that the native engine supports (macOS ARM/x64, Linux x64 or ARM64 with glibc 2.39 or later, or Windows x64).
❌ Error: … is installed, but the system could not load it
- The next line names the cause. On Linux it is usually a missing system library, such as
libgstapp-1.0.so.0: cannot open shared object file. Install the packages listed under Linux runtime dependencies.
❌ Error: SyntaxError: Unexpected token 'import'
- Ensure your script is named index.ts for TypeScript support in Bun.
Next Steps#
Congratulations! You’ve successfully integrated CE.SDK Engine with the native engine of @cesdk/node using Bun. Next, explore: