Runtime Guides
Cloudflare Runtime
Encode placeholders in Cloudflare Workers through cf.image transforms.
When to use
Section titled “When to use”Use blurkit/cloudflare for Cloudflare Workers where ImageDecoder or OffscreenCanvas is not available.
Example
Section titled “Example”import { createCloudflareCache, encode } from 'blurkit/cloudflare'
const cache = createCloudflareCache({ ttlSeconds: 300 })
const result = await encode('https://example.com/image.jpg', { size: 24, cache,})Inputs / Options / Behavior
Section titled “Inputs / Options / Behavior”- Supported inputs:
- remote
http/httpsURL string URL
- remote
- Uses
cf.imagetransform fetch options. - Includes
encodeMany()andencodeManySettled(). - Supports
createCloudflareCache()backed by Worker Cache API.
Limits / Caveats
Section titled “Limits / Caveats”- Local paths,
Blob, andArrayBufferare not supported. - Requires Cloudflare Worker runtime features (
cf.image, Cache API).