Node / Canvas · guide
Primary backgrounds (pick exactly one)
Current Apexify.js 6.0.0 documentation for Primary backgrounds (pick exactly one).
The rule
Among colorBg, gradientBg, customBg, videoBg, and transparentBase: true, activate only one primary background per call.
If multiple primary backgrounds are configured, createCanvas rejects the configuration before painting.
Option A — Solid color (colorBg)
Special: colorBg: 'transparent' skips painting opaque color on that branch (often paired with transparent base or layers).
Option B — Gradient (gradientBg)
Uses GradientConfig: linear, radial, or conic with colors stops.
Option C — Image (customBg)
| Field | Purpose |
|---|---|
source | File path or http(s) URL |
inherit | true → set width/height from image |
fit | fill | contain | cover |
align | Position when letterboxing |
opacity | Layer alpha |
filters | Optional ImageFilter[] |
Option D — Video frame (videoBg)
Requires FFmpeg. Apexify extracts one still frame once, then renders that still through the same image-background placement/filter pipeline as customBg.
| Field | Purpose |
|---|---|
source | Path, URL, or Buffer |
frame | 1-based frame number; mutually exclusive with time |
time | Timestamp in seconds; mutually exclusive with frame |
format, quality | jpg | png, FFmpeg image quality 1–31 |
inherit | true → use extracted-frame width/height for the canvas |
fit | fill | contain | cover |
align | Placement for contain / cover |
filters | Same ImageFilter[] pipeline as customBg |
opacity | Still-image alpha, multiplied by canvas opacity |
If neither frame nor time is supplied, Apexify selects frame 1. Legacy loop and autoplay fields are deprecated because videoBg is a still-frame background, not video playback.
After the primary fill
You can still add bgLayers, patternBg, noiseBg on top — see the following pages.