Your stack,
through small contracts.
The core processes an asset through a repository, object storage, and a media engine. A BullMQ adapter adds background queueing and worker management.
Repository
AssetRepository loads an asset and records processing, ready, rejected, and failed states. Implement it for your own schema, or use PostgresAssetRepository and its migration helper. The PostgreSQL adapter defaults to checksum deduplication within a namespace.
Storage
ObjectStorage needs get and put; streaming reads and delete are optional. createS3Storage takes an AWS SDK S3Client and bucket, so it works with AWS S3 and compatible APIs such as Cloudflare R2 and MinIO. Install @aws-sdk/client-s3 when importing its client directly.
import { S3Client } from "@aws-sdk/client-s3";
import { createS3Storage } from "renditionkit/storage-s3";
const storage = createS3Storage({
client: new S3Client({ region: process.env.S3_REGION! }),
bucket: process.env.S3_BUCKET!,
});Queue
The core is queue-neutral. The provided BullMQ adapter supplies createMediaQueue and createMediaWorker, backed by Redis. Jobs carry an asset ID, not the image bytes or mutable asset details.
Image engine
createImageEngine uses Sharp. Defaults are widths 400, 800, 1600, and 2400, with AVIF and WebP output. It caps the ladder at the source width and includes the exact source width when useful. JPEG output, formats, widths, quality, animation handling, and ThumbHash generation can be configured.