Runtime Guides
Edge Runtime
Encode placeholders in worker-style runtimes with native decode first and wasm fallback.
- entrypoint
- blurkit/edge
- backend
- native + wasm
- install
- blurkit-wasm-codecs (fallback)
Why this runtime
Use blurkit/edge for worker-style runtimes when you want one entrypoint that prefers native decode APIs and falls back to wasm when they are missing.
Encode a remote image
import { encode } from 'blurkit/edge'
const result = await encode('https://example.com/image.jpg')Backend selection
- Supported inputs:
- remote
http/httpsURL string URLBlobArrayBufferUint8Array
- remote
- Includes
encodeMany()andencodeManySettled(). - Backend selection happens before decoding:
- native backend when
ImageDecoderandOffscreenCanvasare both available - wasm backend when either API is missing
- native backend when
- The wasm backend requires
blurkit-wasm-codecsto be installed.
Edge limits
- Non-remote string input is rejected.
- The fallback is chosen by API availability, not by failure: once the native backend is selected, decode errors propagate and are not retried with wasm.
- If the wasm codecs are missing, edge throws
BLURKIT_MISSING_WASM_CODECS. - For Cloudflare Workers, prefer
blurkit/cloudflare.