Node.js integration

Use Node.js 22.12 or later in the 22.x series, or Node.js 24 or later. Save the SDK's ES module as sdk/decodebox.mjs beside your script and import it from an ES module.

// example.mjs
import DecodeBox from "./sdk/decodebox.mjs";

await DecodeBox.ready;
console.log(await DecodeBox.executeOperation("to-base64", "Hello")); // SGVsbG8=

Run the example with node example.mjs.

Versioned files and checksums

Official milestone archives are published from exact Git tags for stable releases whose PATCH component is zero, such as 0.3.0 or 0.4.0. Choose one and substitute its version for X.Y.Z in the following URLs. The v1 segment is the SDK API major.

FilePath on decodebox.owasp.org
Classic script/sdk/v1/X.Y.Z/decodebox.js
ES module/sdk/v1/X.Y.Z/decodebox.mjs
TypeScript declarations/sdk/v1/X.Y.Z/decodebox.d.mts
Checksums/sdk/v1/X.Y.Z/SHA256SUMS

Save the three SDK files and the manifest from the same version in one directory and verify them with sha256sum -c SHA256SUMS. Compare the digest against a trusted pin when your integration requires independent verification.

To build the files locally, check out a release tag and run the following commands from the DecodeBox repository root. The build writes the SDK aliases under dist/sdk/, the classic browser alias to dist/api.js, and the staging manifest to build/sdk/.

npm ci
npm run build:sdk
npm run check:sdk-dist

TypeScript

Put decodebox.d.mts next to decodebox.mjs and use a compatible module resolver such as NodeNext or Bundler.

import DecodeBox, { type Step } from "./sdk/decodebox.mjs";

await DecodeBox.ready;

const steps: Step[] = [{ opId: "from-base64" }];
const result = await DecodeBox.bake("SGVsbG8=", steps);

if (result.error) throw new Error(result.error.message);
console.log(result.output); // Hello