Build a small warehouse application, drive it from JavaScript, and save a recording of the result.
The Wax side of this example is on the Embedding Wax overview. Read it first to understand Wax's three communication paths and their recording behaviour.
Download the complete example (.tar.gz). Extract it and open a terminal in the extracted directory. It includes the Wax source, manifest, host source, and host build files used below.
Install Wax and add its tools to your PATH. You also need: Node.js 25 or newer.
The generated binding works in browsers and Node. This guide uses Node so the complete example runs from the command line; a web app serves the generated app Wasm, runtime Wasm, manifest, and JavaScript modules together over HTTP.
In a browser, serve the complete generated directory and load it with await Warehouse.load(baseUrl, { hostFns }). Use the same host callbacks shown below; baseUrl is the directory URL ending in a slash. Save the bytes from createRecording() using your application’s download or storage API.
Generate the JavaScript binding.
Ask the Wax compiler for a JavaScript binding, then build the project. The generated code contains the typed host functions, channels, and APIs declared in the Wax source on the embedding overview.
wax.json
$ wax build
The JavaScript side.
The host connects the services Wax needs, stages channel data, runs frames, calls Wax APIs, and writes the recording.
Host/javascript/main.mjs
Run it.
Build the Wax project, run the JavaScript host, then open the resulting warehouse.wxs recording in the debugger.
warehouse
Host guides.
Choose a host language to wire this Wax interface into an application.