Quick start

Save this example as example.html and open it in your browser. The page loads the hosted SDK and decodes SGVsbG8= to Hello.

<!doctype html>
<html lang="en">
  <meta charset="utf-8">
  <title>DecodeBox example</title>
  <output id="result">Loading…</output>
  <script src="https://decodebox.owasp.org/api.js"></script>
  <script type="module">
    const result = document.querySelector("#result");
    try {
      await DecodeBox.ready;
      result.textContent = await DecodeBox.executeOperation("from-base64", "SGVsbG8=");
    } catch (error) {
      result.textContent = error.message;
    }
  </script>
</html>

The SDK executes the operation in the browser. To run the example offline, put a local copy of decodebox.js next to example.html and change the script source to ./decodebox.js. See versioned files and checksums for details on obtaining and verifying a bundle.