webapi Example
Zig + WebAssembly + Browser APIs with zero global callbacks
WebGL 3D Die & 2D Canvas Text Banner
Clicks: 0 | Tint: (1.00, 0.85, 0.55)
DOM Input & Keyboard Events
Echo: (empty)
Last key pressed: (none)
Fetch API, Promises & File Download
Click "Fetch data.json" to run webapi.fetch().
Web Crypto (window.crypto)
Click a button to test window.crypto.
WASI Hello World
Click "Run wasi_hello.wasm" to run a WASI binary in-browser.
Web Workers (Worker + DedicatedWorkerGlobalScope)
Click "Send to Worker" to run Zig WASM in a background Web Worker.
Web Audio API (AudioContext + AudioBuffer)
Click a button to play a generated PCM sine buffer or decode blue-beep.mp3.
Audio Input (MediaDevices + AnalyserNode)
Click "Start Microphone" to stream live audio into WebAudio.AnalyserNode, or enumerate audio/video devices.
Video Input (getUserMedia + HTMLVideoElement)
Click "Start Camera" to preview a live MediaStream in <video> and capture frames to <canvas>.
Geolocation API (navigator.geolocation)
Click a button to query navigator.geolocation (requires permission and HTTPS or localhost).
Web Share API (navigator.share)
Click a button to test navigator.canShare() and navigator.share().
Drag & Drop File Metadata (DragEvent + DataTransfer + File)
Drop files here to inspect metadata
Drop one or more files above to print name, size, MIME type, and lastModified.
WebSocket Pub/Sub (WebSocket + ntfy.sh)
Click "Connect WebSocket" to subscribe to wss://ntfy.sh/<topic>/ws, then publish messages.