Skip to main content

Examples

Each example is small, runs on your own machine with the open reference software alone, and is a template of wai create. Each has a test in the repository that runs it the way these commands do. Start with the quickstart to install wai.

A video room in one page

Your own page with a live room in it: each tab makes its own key, gets a grant for it, and checks every object against its receipt before it decodes it.

See it now

The live room, on this site.

Free: build and run it yourself

wai create my-video-room --template video-room
cd my-video-room
wai dev

Needs a browser. The code and its README.

Watch together

Everyone in a room watches one file in sync. Play, pause and seek are signed controls that apply at one instant on the room's clock, for everyone.

Free: build and run it yourself

wai create my-watch-together --template watch-together
cd my-watch-together
wai dev

Needs a browser. The code and its README.

Messaging and a call

An end-to-end encrypted conversation, each message sealed in the tab, and a call placed, rung in the other's inbox and answered in a room.

Free: build and run it yourself

wai create my-messaging --template messaging
cd my-messaging
wai dev

Needs a browser. The code and its README.

Stream from an encoder into a room

An SRT encoder's stream published into a room by an ingest gateway. The gateway signs each group's receipt; the relay and a subscriber check every object against it.

Free: build and run it yourself

wai create my-encoder-ingest --template encoder-ingest
cd my-encoder-ingest
cargo run --release

Needs Rust. The code and its README.

Package a title and play it

A title packed by policy into WAI objects and a standard floor, with HLS and DASH playlists and a MoQ catalog; the package verified; the floor played in a page.

See it now

Cargo, measured, on this site.

Free: build and run it yourself

wai create my-package-and-deliver --template package-and-deliver
cd my-package-and-deliver
sh pack.sh
wai dev

Needs a browser. The code and its README.

Verify receipts in Rust and in Python

The receipts beside an object checked offline twice: by the reference implementation, and by a second one in Python's standard library alone.

Free: build and run it yourself

wai create my-verify-receipts --template verify-receipts
cd my-verify-receipts
wai hello receipts
python3 python/verify_receipts.py receipts
cd rust && cargo run --release -- ../receipts

Needs Rust and Python. The code and its README.

A native app on Apple platforms

The native sink in a SwiftUI app: the platform's player plays as it always does, and the sink verifies, acknowledges and signs what it receives.

Free: build and run it yourself

wai create my-apple-app --template apple-app
cd my-apple-app
swift run WaiApp --replay sample-session.json
swift run WaiApp

Needs Xcode, and the wai-sink-swift package built from the repository. The code and its README.

The native sink in Kotlin, for Android

The native sink's Kotlin API, the one an Android app's player session calls: a recorded playback session through the sink, and its signed bundle verified.

Free: build and run it yourself

wai create my-android-app --template android-app
cd my-android-app
gradle :replay:run

Needs a JDK 17, and the wai-sink-android project built from the repository. The code and its README.

Remote desktop in a room

One machine's screen shared into a room. Viewers watch; one at a time drives it; every screen statement, input and handover is a signed record a verifier checks.

Free: build and run it yourself

wai create my-remote-desktop --template remote-desktop
cd my-remote-desktop
wai dev
sh host.sh --pattern

Needs a browser. The code and its README.

Working with a coding assistant? wai setup-agent in a project writes the instructions an assistant reads and connects it to WAI's tools. Every example's README says so too.