# Example apps

> Three small apps you can download and run against the sandbox or a built-in mock: a customer wallet, a treasury dashboard and a policy-governed treasury agent. Node.js 20, no dependencies.

Source: https://business-api-docs.youhodler.com/examples

Each app shows one integration end to end, in a few hundred lines you can read
in one sitting. Download it, run it against a built-in mock to click through
without credentials, then point it at the sandbox with your service account.

> **Sandbox:** The examples run against the sandbox. Production access is granted after a review; see [Overview](/intro).

## What every example has

- **Node.js 20 or later and no npm dependencies.** No build step: unzip,
`npm start`.
- **A small server and a plain HTML page.** The server holds the credentials
and the access token; the browser never sees them.
- **Mock mode.** `npm run start:mock` runs against a built-in fake of the
endpoints the app uses, with responses shaped like the API contract
examples. The page says when mock mode is on. The fake does not model the
platform's rules, so use the sandbox to learn real behaviour.
- **Sandbox mode.** Copy `.env.example` to `.env`, fill in the sandbox base
URL and the service account's client id and secret, then `npm start`. The
README lists the capabilities the service account needs.
- **Tests.** `npm test` runs offline against the fake.

## The apps

### crypto-wallet

**Status:** In the API

A customer wallet inside your product:
balances, a deposit address for a chosen asset and network, a swap with a
preview, a withdrawal to a saved destination, and an activity list.

Guide: [Crypto apps and embedded finance](/use-cases/crypto-app-and-embedded-finance) ·
Download: [crypto-wallet.zip](/example-apps/crypto-wallet.zip)

### treasury-dashboard

**Status:** In the API

Balances across the master account and client
accounts, a conversion with a preview, an internal transfer, and recent
operations with their statuses.

Guide: [Treasury and international payments](/use-cases/treasury-and-international-payments) ·
Download: [treasury-dashboard.zip](/example-apps/treasury-dashboard.zip)

### treasury-agent

**Status:** In the API

A rule-based agent that reads balances,
proposes a conversion, previews it, submits it, and handles each outcome:
executed, held for approval, or refused. Every decision goes to an
append-only log, and a `--dry-run` flag only previews. The decision function
is pluggable, so a model-driven agent can replace the rule.

Guide: [AI agents and treasury automation](/use-cases/ai-treasury-agent) ·
Download: [treasury-agent.zip](/example-apps/treasury-agent.zip)

## Run one

```bash
unzip crypto-wallet.zip && cd crypto-wallet
npm run start:mock        # click through without credentials
cp .env.example .env      # then fill in the sandbox values
npm start                 # the same app against the sandbox
npm test                  # offline tests against the mock
```

Each app prints the local URL it serves on. Its README explains which screen
calls which API operation.

## Next steps

- New to the API: start with the [Quickstart](/quickstart).
- Check your currencies and rails: [Supported assets and status](/coverage).
- Keep your system in sync: [Transaction lifecycle](/guides/transaction-lifecycle).
