Getting Started

What is the browser adapter?

The browser adapter is a Traverse placement target that runs WASM capabilities directly inside the user's browser. It uses the browser's native WebAssembly API and applies the same contract validation as every other Traverse target. The capability behaves identically whether it is called from the browser or from a server.

Why run capabilities in the browser

The main reason is consistency. If your pricing logic runs as a WASM capability on your API, you can load the same binary in the browser for instant previews. The user sees the correct number before they submit a form. No extra round-trip. No risk of the frontend computing a different result than the backend.

This is the core promise of Traverse placement targets. The contract is the invariant. The adapter is just where the execution happens.

How it works

The traverse-expedition-wasm crate compiles to a WASM binary that can itself run inside a browser. It bootstraps the Traverse runtime, loads your capability binary from a URL or bundled asset, and exposes a JavaScript API you can call from your frontend code.

  • Preconditions are validated before execution, same as on the server
  • Postconditions are validated after the WASM function returns
  • The result object includes a trace artifact for debugging
  • Errors are typed and match the contract's error schema

Current status

The local placement target is the only fully implemented target in v0.7.0. Browser, edge, cloud, and AI pipeline targets are on the roadmap. The browser adapter is in active development. The API shape is stable but browser deployment is not yet production-ready.

See the roadmap for the planned release timeline.