Skip to main content

Web decoder API

Create one decoder per independent session. Pass licenseToken for web activation and wasm for a custom URL, module, or buffer. The supplied index.d.mts lists supported options.

MethodResult
licenseStatus()Effective mode for this instance
requestJSON(bytes, options)Exact JSON envelope as a string
decode(bytes, options)Parsed envelope for convenient field access
decodeJSON(bytes, options)ST 0601 JSON text
createStream(options, onDecoded, onError?)Synchronous push, pushPES, flush, close, and cancel
close()Release streams and decoder resources; use await in cleanup

Use memoryBytes() to inspect the current WASM memory size when available. cancel() discards buffered stream input. To deliver final events, call flush() before closing.

The default operation is packet. Use local for a checksum-bearing local-set value or field with a tag and revision for a single field. The json and local_json operations return JSON text in the envelope's value. The licensed raw operations are raw, find, ber, and items. The envelope reports ok, partial, error, or unknown; check it before using value. Invalid API arguments can throw.

For exact integer output, use the JSON guidance. For a complete lifecycle, see the Node and browser quickstart.