Examples
These examples assume you have loaded the browser SDK or imported the
ES module as DecodeBox.
Run one operation
executeOperation returns the resulting string. It rejects with a DecodeBoxError for invalid
input, unknown operations, execution failures, or limits.
Run a recipe
A recipe runs steps in sequence. Check the returned error field before using the output. Input
validation can also reject the call.
Detect a format
The detector returns candidates with a format, confidence, preview, and supporting evidence. An empty array means it found no candidates.
Discover operation arguments
Use getOperation(id) to read the operation's argument names, types, and defaults. Use
listOperations() to discover the full catalogue.
When passing arguments to executeOperation, use the names from the operation metadata as keys.
Use a string, number, or boolean for a scalar argument and pass { value, format } when specifying
the format of a toggleString argument. Omitted arguments use the SDK defaults.