Skip to content
Apexify.jsDocs
Apexify.js version v5.4.5

Start · tutorial

Install & setup

Current Apexify.js 6.0.0 documentation for Install & setup.

apexify.jsRuntime: nodeCURRENTSince 6.0.0

Release status

These docs describe the staged Apexify.js 6.0.0 package artifact built from the repository. The published npm latest release is still 5.4.5.

TERMINALbash
bash
$ npm install apexify.js

That command currently installs 5.4.5. The documentation website is pinned and tested against an exact staged 6.0 repository commit so its API reference can be validated before publication; do not assume npm already serves 6.0.0.


Requirements for staged 6.0.0

  • Node.js 22.x, 24.x, or 26.x
  • npm 10+ (the repository/release toolchain is pinned to npm 11.19.1)
  • FFmpeg + ffprobe only when using video/FFmpeg features
  • TypeScript is optional; declarations ship with the package artifact

The current package is Node/server-only. Do not try to bundle it directly as a browser runtime.


ESM

SOURCEjavascript
javascript
Studio
import { ApexPainter } from "apexify.js"; const painter = new ApexPainter({ type: "buffer" });

CommonJS

SOURCEjavascript
javascript
Studio
const { ApexPainter } = require("apexify.js"); const painter = new ApexPainter({ type: "buffer" });

The package root is the normal runtime entrypoint. apexify.js/types is type-only; internal dist/* / source paths are unsupported.


TypeScript

SOURCEtypescript
typescript
Studio
import { ApexPainter } from "apexify.js";import type { CanvasConfig, SceneRenderInput } from "apexify.js";import type { VideoPipelineLayer } from "apexify.js/types"; const painter = new ApexPainter({ type: "buffer" });const canvas: CanvasConfig = { width: 320, height: 180, colorBg: "#111827" };const scene: SceneRenderInput = { width: 320, height: 180, layers: [] };let layer!: VideoPipelineLayer; void painter;void canvas;void scene;void layer;

Use Node 22-compatible or newer Node type definitions for staged 6.0 development.


FFmpeg and ffprobe

Only video/FFmpeg functionality requires system FFmpeg/ffprobe. Image, text, chart, scene, GIF, and procedural-audio APIs do not require FFmpeg merely because the package is installed.

Install examples:

TERMINALbash
bash
$ # macOSbrew install ffmpeg # Ubuntu/Debiansudo apt-get install ffmpeg

On Windows, install a trusted FFmpeg build and put its bin directory on PATH.

Custom executable locations can be configured programmatically or with:

SOURCEtext
text
APEXIFY_FFMPEG_PATHAPEXIFY_FFPROBE_PATH

Sanity check

SOURCEtypescript
typescript
Studio
import { writeFile } from "node:fs/promises";import { ApexPainter } from "apexify.js"; const painter = new ApexPainter({ type: "buffer" });const canvas = await painter.createCanvas({  width: 320,  height: 180,  colorBg: "#0f172a",}); const png = await painter.createText(  {    text: "Apexify.js",    x: 160,    y: 90,    font: { size: 32, family: "Arial" },    fill: { color: "#ffffff" },    placement: { textAlign: "center", textBaseline: "middle" },  },  canvas,); await writeFile("hello.png", png);

createCanvas() returns CanvasResults. Drawing/rendering methods return PNG Buffers; choose buffer, url, dataURL, blob, base64, or arraybuffer in the painter constructor and call toOutput(buffer) when you want explicit output conversion.


Next

Next steps