# Examples and validation

Explore Kitchen Sink, generate focused apps, and run source and platform checks.

Source: https://legend.so/spark/examples/

Legend Spark: Experimental — not for production.

These guides cover source SDK APIs; the published preview can differ. [Check release status.](https://legend.so/spark/limitations/)

## [Kitchen Sink](https://legend.so/spark/examples/#kitchen-sink)

From the current source checkout:

```sh
bun run kitchen-sink
```

After installing/preparing the source SDK, normal development starts the managed session; it does not compile a native runtime. A matching registered Runner is required. If needed, build from the checked-in app:

```sh
cd examples/kitchen-sink
bun run rebuild:macos
bun run macos
# On Windows:
# bun run rebuild:windows
# bun run windows
```

Kitchen Sink demonstrates windows/geometry, menus/shortcuts, files/dialogs, streaming/Trash, settings, clipboard, notifications/system APIs, audio, and native controls. Progress, results, and errors appear inline with detailed logs. Disposable filesystem demos create/recycle test data.

`bun run kitchen-sink:prepare /absolute/path/to/KitchenSinkCheck` packs the SDK and creates a separate copied consumer for integration testing. It preserves that consumer's generated identity/configuration rather than changing the checked-in app.

## [Smaller applications](https://legend.so/spark/examples/#smaller-applications)

Create a focused app with npm:

```sh
npm create @legendapp/spark@next MyNotes -- --example notes-lite
npm create @legendapp/spark@next MyMusic -- --example music-lite
npm create @legendapp/spark@next MyDiff -- --example diff-lite
npm create @legendapp/spark@next MyEditor -- --example document-editor
```

Then run the generated app, for example:

```sh
cd MyNotes
npm run macos
```

For local SDK development, [prepare the source SDK](https://legend.so/spark/getting-started/#contributing-build-spark-from-source) and run `bun run spark create /absolute/path/to/MyNotes --example notes-lite` from its checkout.

Notes Lite covers local notes, search, import/export, recovery, and session restoration. Music Lite covers playback/queue ownership. Diff Lite covers text comparison. Document Editor covers file operations, menus, document requests, and desktop lifecycle. These examples are distinct from the full Legend Apps products.

The [helper example](https://github.com/LegendApp/legend-spark/tree/main/examples/sidecar) demonstrates an app-supplied executable without a Node runtime in Hermes. The universal Settings starter uses native controls plus platform adapters.

## [Source checks](https://legend.so/spark/examples/#source-checks)

From the SDK checkout:

```sh
bun run typecheck
bun run test
bun run test:templates
```

`bun run test` uses Vitest, not Bun's test runner. Source checks validate contract behavior, export policy, lifecycle transitions, and tooling; template checks create real consumers. Packed consumer checks separately validate the archive's dependency graph and declarations.

## [Native and platform checks](https://legend.so/spark/examples/#native-and-platform-checks)

Native suites need their toolchains and disposable consumer projects. Read prerequisites before running them. Relevant commands include:

| Command | Purpose |
| --- | --- |
| `bun run test:native` | Native API probes |
| `bun run test:ui` | Packed native UI consumer |
| `bun run test:platform --platform <target>` | Shared contract catalog on a target |
| `bun run test:windows` | Windows Runner → Fast Refresh → added module → custom build |
| `bun run test:windows:prepare` | Generation/bundles without Windows native execution |
| `bun run test:runtimes:all` | Runner/dev/release background runtimes and pruning |
| `bun run test:universal` / `bun run test:universal:dev` | Universal generation/bundles and shared sessions |
| `bun run test:add-desktop` | Existing Expo app preservation/composition |

Run your app on each target OS and architecture to check native behavior as well as generation and bundling.

See the [platform testing guide](https://github.com/LegendApp/legend-spark/blob/main/docs/platform-testing.md), [manual testing checklist](https://github.com/LegendApp/legend-spark/blob/main/docs/desktop-manual-acceptance.md), and [platform limits](https://legend.so/spark/limitations/).

[View Markdown](https://legend.so/spark/examples.md)[Report a documentation correction](https://github.com/LegendApp/legend-docs/issues/new?title=Docs%3A+Examples+and+validation&body=Page%3A+https%3A%2F%2Flegend.so%2Fspark%2Fexamples%0A%0AWhat+is+incorrect+or+missing%3F%0A%0AExpected+behavior+or+supporting+source%3A%0A)
