SDK JS
    Preparing search index...

    Interface WasmHostInit

    Per-decoder override of where the vendored WebP .wasm is loaded from. Both fields are optional; when neither is set the loader falls back to the SDK-global wasmBaseUrl (see configuredWasmUrl) and then to the build default. An explicit field here takes precedence over the global configuration.

    This is the codec's slice of the SDK-wide wasm-host init contract, which is documented once on the core configuration (see BitruviusConfig.wasmBaseUrl). wasmBytes wins over wasmUrl when both are provided.

    interface WasmHostInit {
        wasmBytes?: BufferSource;
        wasmUrl?: string | URL;
    }
    Index

    Properties

    Properties

    wasmBytes?: BufferSource

    The raw wasm module bytes, already in memory (e.g. read off disk in Node/Bun or pre-fetched). Highest precedence; skips any URL fetch.

    wasmUrl?: string | URL

    Absolute (or document-relative) URL to fetch turbowebp_wasm_bg.wasm from — the cross-origin / CDN pattern. Ignored when WasmHostInit.wasmBytes is set.