Skip to content

Creative Build Artifacts and Debug Information

This document outlines where to find important build artifacts and debug information for creatives in the Cavai platform.

Source of Truth for Creative Builds

The source of truth for determining if a creative has been built correctly can be found in:

Application-Backend > tmp > creatives > assets > creatives > [creative-id] > built > assets > stub.js

Where [creative-id] is the numeric ID of the creative (e.g., 86). This ID can be found in the URL when viewing the creative in the Cavai platform.

Important Files and Their Locations

creative-engine.js

This is the complete Creative-Engine output file containing all components and logic for the creative. Located at:

Application-Backend/tmp/creatives/assets/creatives/[creative-id]/built/assets/creative-engine.js

This file is crucial for debugging as it contains the entire Creative-Engine output. Examining this file can help identify if components are properly registered and included in the build. The stub.js file depends on creative-engine.js being correct.

stub.js

This is the main compiled creative file that indicates whether the creative has been built successfully. Located at:

Application-Backend/tmp/creatives/assets/creatives/[creative-id]/built/assets/stub.js

log.txt

Contains build logs from Creative-Composer, which is responsible for compressing and creating content rendered by Creative-Engine. Located at:

Application-Backend/tmp/creatives/assets/creatives/[creative-id]/log.txt

Example log entries come from Creative-Composer's build process. For instance, in Creative-Composer/src/bin/commands/job.ts line 78:

typescript
log.info('building the creative');

This message will be logged to the log.txt file in the Application-Backend.

creative.json

Contains the complete creative configuration data. Located at:

Application-Backend/tmp/creatives/assets/creatives/[creative-id]/creative.json

tag.html

Contains the HTML tag used for embedding the creative. Located at:

Application-Backend/tmp/creatives/assets/creatives/[creative-id]/tag.html

This file contains the local file path with the creative's ID and other important information.

Debugging Build Issues

When troubleshooting build problems:

  1. Check creative-engine.js to see if it was built correctly and contains the expected components
  2. Check stub.js to see if it was generated correctly (this depends on creative-engine.js)
  3. Review log.txt for any error messages during the build process
  4. Verify creative.json for correct structure and data
  5. Examine tag.html to ensure proper configuration

Relationship to Creative-Composer

The Creative-Composer package is responsible for building and compressing the content. It logs its operations to log.txt, which can be essential for debugging build failures.

Key build stages from Creative-Composer (found in job.ts):

  1. Remapping the JSON (createPayload)
  2. Creating the profile (createProfile)
  3. Running fileposer (processSrcFiles)
  4. Building the creative
  5. Generating tagstub (injectTag)

Internal documentation