> ## Documentation Index
> Fetch the complete documentation index at: https://docs.elata.bio/llms.txt
> Use this file to discover all available pages before exploring further.

# Build your first Elata App

> Scaffold a working app first, then use it as the reference point for deeper SDK integration.

> [!WARNING]
>
> The repository's `create-elata-demo` 0.12.1 has a packaging blocker: missing `app-metrics` version metadata prevents startup. Check [scaffolder status](https://docs.elata.bio/sdk/create-elata-demo.md) before using the commands below; for now, follow [manual rPPG integration](https://docs.elata.bio/sdk/tutorials/rppg-existing-app.md).

Use this page if you are new to the SDK and want one successful scaffolded app
running locally before you integrate anything manually.

If you want the full map (**rPPG primary**, **EEG optional**, **Bluetooth to
connect a headset**) with scaffold vs step-by-step vs overview, use
[the SDK overview](https://docs.elata.bio/sdk/overview.md).

The goal is simple: get a working app running locally, understand which
template maps to which sensor workflow, and know where to go next.

## What You Will Build

You will scaffold one of the published starter apps with
`@elata-biosciences/create-elata-demo`.

Pick the template that matches your goal:

* `rppg-demo`: **primary**: camera-based pulse/rPPG app
* `eeg-demo`: browser EEG processing, with Muse Web Bluetooth support
* `eeg-ble`: Bluetooth-first EEG starter for a Muse-compatible headset
* `ppg-demo`: heart rate and HRV from a Muse headband's PPG sensor
* `pulse-game`: an rPPG game that runs in a sandboxed iframe and saves scores, the way apps run in Elata

## Why Start Here

This is the recommended default because it gives you:

* a working app structure
* pinned compatible package versions
* a reference implementation you can compare your own app against

Do this before integrating the SDK into an existing app.

## Step 1: Choose A Template

Use this decision table:

| If you want to... | Choose |
| - | - |
| Build the default camera-based app (no extra hardware) | `rppg-demo` |
| Add browser EEG only (synthetic or offline samples first) | `eeg-demo` |
| Enable a Muse-compatible headset over Bluetooth (Chrome/Edge) | `eeg-ble` |
| Read heart rate and HRV from a Muse headband | `ppg-demo` |
| See the full Elata pattern (sandboxed iframe + saved scores) | `pulse-game` |

If you are unsure, start with `rppg-demo`.

## Step 2: Scaffold The App

Start with the interactive chooser:

```bash pnpm theme={null}
pnpm create @elata-biosciences/elata-demo my-app
```

```bash npm theme={null}
npm create @elata-biosciences/elata-demo my-app
```

If you prefer the explicit default path instead, scaffold `rppg-demo`
directly:

```bash pnpm theme={null}
pnpm create @elata-biosciences/elata-demo my-app -- --template rppg
```

```bash npm theme={null}
npm create @elata-biosciences/elata-demo my-app -- --template rppg
```

If you want to see the full template list first:

```bash pnpm theme={null}
pnpm dlx @elata-biosciences/create-elata-demo --list-templates
```

```bash npm theme={null}
npx @elata-biosciences/create-elata-demo --list-templates
```

The full alias and template matrix lives on [create-elata-demo](https://docs.elata.bio/sdk/create-elata-demo.md).

## Step 3: Install And Run

Copy **one** column (pnpm or npm), then run each line in order:

```bash pnpm theme={null}
cd my-app
pnpm install
pnpm run dev
```

```bash npm theme={null}
cd my-app
npm install
npm run dev
```

## Step 4: Confirm What You Have

Once the app starts, verify the expected behavior:

* `rppg-demo`: asks for camera access and starts a pulse-style session
* `eeg-demo`: loads EEG processing in the browser and shows synthetic-data-driven output
* `eeg-ble`: adds Bluetooth pairing and streaming for a supported Muse-compatible headset on top of EEG
* `ppg-demo`: connects a Muse headband and shows BPM, RMSSD, and live PPG diagnostics
* `pulse-game`: runs the game inside a sandboxed iframe and saves scores through a local host, the way Elata does

If your goal is just evaluation, stop here first and learn from the generated
app before integrating into an existing codebase.

## Step 5: Understand The Generated App

Each scaffolded app gives you:

* a minimal Vite + React shell
* Elata packages already wired in
* a `README.md` with template-specific notes
* a `build` script so you can confirm the app compiles cleanly
* a `build:zip` script that packages the app for [upload to Elata](https://docs.elata.bio/apps/build/launch-your-app.md)

This is meant to be your known-good baseline.

When a manual integration goes wrong later, compare your app against this
generated one before assuming the package is broken.

## Common Gotcha: Scaffolding Inside Another `pnpm` Workspace

If you create `my-app` inside another repository that already has a
`pnpm-workspace.yaml`, `pnpm install` may attach to the parent workspace
instead of the generated app.

Run these **one line at a time** from the parent directory (adjust `my-app` if needed):

```bash pnpm theme={null}
pnpm --dir my-app --ignore-workspace install
pnpm --dir my-app --ignore-workspace run dev
```

```bash npm theme={null}
cd my-app
npm install
npm run dev
```

## Where To Go Next

You already have a running scaffold. The recommended order is **camera rPPG
first** (most people’s primary app), **browser EEG second if the product needs
brain signals**, then **Web Bluetooth to connect a headset** (transport on top
of EEG). Each step splits the same way: **stay on the scaffold** or **integrate
into an app you already have**.

### Next: Camera (rPPG): primary

Pick the row that matches you:

| Your situation | What to do next |
| - | - |
| **New app**: you will keep building from the generated `rppg-demo` scaffold | Use [rPPG In A Browser App](https://docs.elata.bio/sdk/guides/rppg-browser.md) for the integration model, then [rppg-web](https://docs.elata.bio/sdk/rppg-web/getting-started.md) while you change the template. For scaffold CLI details: [create-elata-demo](https://docs.elata.bio/sdk/create-elata-demo.md). |
| **Existing app**: you need rPPG inside a codebase you already ship | Follow [Add Camera-Based rPPG To An Existing Browser App](https://docs.elata.bio/sdk/tutorials/rppg-existing-app.md) step by step. |

### Then: Browser EEG: optional (no headset yet)

| Your situation | What to do next |
| - | - |
| **New app**: extend or respin `eeg-demo` | [EEG In A Browser App](https://docs.elata.bio/sdk/guides/eeg-browser.md), then [eeg-web](https://docs.elata.bio/sdk/eeg-web/getting-started.md). Scaffold reference: [create-elata-demo](https://docs.elata.bio/sdk/create-elata-demo.md). |
| **Existing app** | [Add EEG To An Existing Browser App](https://docs.elata.bio/sdk/tutorials/eeg-existing-app.md). |

### Then: Enable Bluetooth headset (Muse-compatible)

| Your situation | What to do next |
| - | - |
| **New app**: extend the `eeg-ble` scaffold | [Web Bluetooth With Supported Devices](https://docs.elata.bio/sdk/guides/web-bluetooth.md), then [eeg-web-ble](https://docs.elata.bio/sdk/eeg-web-ble/getting-started.md) (and [eeg-web](https://docs.elata.bio/sdk/eeg-web/getting-started.md)). |
| **Existing app** | [Stream Muse-Compatible EEG Over Web Bluetooth](https://docs.elata.bio/sdk/tutorials/eeg-ble-live-stream.md). If WASM is not wired yet, do the EEG row above first. |

### Full map

For the same choices in one place in **priority order** (rPPG, then EEG, then
Bluetooth), use [the SDK overview](https://docs.elata.bio/sdk/overview.md).

### Example Apps

> [card] [Example Apps](https://docs.elata.bio/sdk/guides/example-apps.md)
>
> Full product-shaped reference implementations

> [card] [Choose A Package](https://docs.elata.bio/sdk/guides/choose-the-right-package.md)
>
> Package decision guide


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.