Runtime Guides
WASM Runtime
Encode placeholders with wasm decode/resize in runtimes without native image decode APIs.
- entrypoint
- blurkit/wasm
- backend
- wasm codecs
- install
- blurkit-wasm-codecs
Why this runtime
Use blurkit/wasm when your target runtime does not provide ImageDecoder and OffscreenCanvas, but you still need consistent placeholder generation.
Encode with wasm codecs
import { encode } from 'blurkit/wasm'
const result = await encode('https://example.com/image.webp', { size: 32,})Decode and output support
- Supported inputs:
- remote
http/httpsURL string URLBlobArrayBufferUint8Array
- remote
- Decode support: PNG, JPEG, WebP.
- Output support: PNG or JPEG data URL (via
outputFormat). - Includes
encodeMany()andencodeManySettled(). - Requires
blurkit-wasm-codecsto be installed in your project.
WASM limits
- Local filesystem path strings are rejected.
- Decode support is intentionally limited to PNG/JPEG/WebP.
- Remote URL input still depends on network reachability and runtime fetch behavior.
- If codecs package is missing, calls throw
BLURKIT_MISSING_WASM_CODECS.