# 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. Install `wai` first: [the quickstart](/docs/quickstart.md).

## A video room in one page

Template `video-room`. 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](/room/), on this site.

**Free: build and run it yourself** (needs a browser):

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

The code: https://git.transaction.science/Transaction-Science/open-standards/src/branch/main/wai/examples/video-room

## Watch together

Template `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** (needs a browser):

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

The code: https://git.transaction.science/Transaction-Science/open-standards/src/branch/main/wai/examples/watch-together

## Messaging and a call

Template `messaging`. 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** (needs a browser):

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

The code: https://git.transaction.science/Transaction-Science/open-standards/src/branch/main/wai/examples/messaging

## Stream from an encoder into a room

Template `encoder-ingest`. 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** (needs Rust):

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

The code: https://git.transaction.science/Transaction-Science/open-standards/src/branch/main/wai/examples/encoder-ingest

## Package a title and play it

Template `package-and-deliver`. 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](/cargo/), on this site.

**Free: build and run it yourself** (needs a browser):

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

The code: https://git.transaction.science/Transaction-Science/open-standards/src/branch/main/wai/examples/package-and-deliver

## Verify receipts in Rust and in Python

Template `verify-receipts`. 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** (needs Rust and Python):

```sh
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
```

The code: https://git.transaction.science/Transaction-Science/open-standards/src/branch/main/wai/examples/verify-receipts

## A native app on Apple platforms

Template `apple-app`. 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** (needs Xcode, and the wai-sink-swift package built from the repository):

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

The code: https://git.transaction.science/Transaction-Science/open-standards/src/branch/main/wai/examples/apple-app

## The native sink in Kotlin, for Android

Template `android-app`. 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** (needs a JDK 17, and the wai-sink-android project built from the repository):

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

The code: https://git.transaction.science/Transaction-Science/open-standards/src/branch/main/wai/examples/android-app

## Remote desktop in a room

Template `remote-desktop`. 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** (needs a browser):

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

The code: https://git.transaction.science/Transaction-Science/open-standards/src/branch/main/wai/examples/remote-desktop

Working with a coding assistant? `wai setup-agent` in a project writes the instructions an assistant reads and connects it to WAI's tools.
