Documentation
Technical reference for blurkit runtimes, API behavior, CLI usage, and production patterns.
Overview
- Overview
- Installation
- Quick Start
- Node Runtime
- Deno Runtime
- Browser Runtime
- CLI Overview
- Single Image
- Manifest Generation
- API: encode()
- API: encodeMany()
- API: Options
- Guide: Next.js
- Guide: Build-time Manifests
- Guide: Browser Uploader Flow
- Limits and Caveats
- Roadmap
blurkit generates compact placeholder images using BlurHash or ThumbHash so you never ship a layout without knowing image dimensions. It runs on Node, Deno, the browser, edge workers, and Cloudflare — one API, no platform lock-in.
Example
Section titled “Example”import { encode } from 'blurkit/node'
const result = await encode('./public/hero.jpg', { algorithm: 'blurhash', size: 32,})
console.log(result.dataURL)Inputs / Options / Behavior
Section titled “Inputs / Options / Behavior”- blurkit ships explicit runtime entrypoints:
blurkit/node,blurkit/deno,blurkit/browser,blurkit/edge,blurkit/cloudflare, andblurkit/wasm. - Root import
blurkitresolves by export conditions (node,browser,worker) without runtime dynamic dispatch. - Successful
encode()returnsdataURL,hash,algorithm,width,height, andmeta. encodeMany()is fail-fast.encodeManySettled()returns per-item success/failure results.
Integration Examples
Section titled “Integration Examples”- Next.js minimal example: apps/example-nextjs
- Astro minimal example: apps/example-astro
Limits / Caveats
Section titled “Limits / Caveats”- Node runtime requires
sharp. - Deno runtime requires
blurkit-wasm-codecsand uses wasm-backed decode with canvas render. - Browser runtime cannot read local filesystem paths.
- Edge runtime uses native decode APIs when available, then falls back to wasm.
- Cloudflare runtime accepts remote URL input only.
- WASM runtime decode support is PNG/JPEG/WebP.
- Remote URL input depends on network reachability and, in browsers, CORS.