> ## 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.

# Claude Code

> Use Claude Code to build Elata apps with the Elata SDK and Elata APIs.

## Overview

Claude Code works best on Elata apps when it knows how Elata works: the
sandbox, the SDK packages, and the upload rules. This page gives you a project
context file to paste in, plus prompts for common tasks.

***

## Setup

1. Install Claude Code by following the [Claude Code docs](https://docs.claude.com/en/docs/claude-code/overview).
2. Open a terminal in your project and run `claude`.
3. Add a `CLAUDE.md` file at your project root with the context below.

***

## Project context

Save this as `CLAUDE.md` at your project root:

```markdown CLAUDE.md theme={null}
# Elata app

This is a browser app for Elata (https://app.elata.bio), built on
the Elata SDK. It is a static web build that runs inside a sandboxed
iframe in Elata.

## Docs
- Docs home: https://docs.elata.bio (full text for agents: https://docs.elata.bio/llms-full.txt)
- Building apps: https://docs.elata.bio/apps/build/overview
- Host bridge (Elata APIs): https://docs.elata.bio/apps/platform/host-bridge
- SDK overview: https://docs.elata.bio/sdk/overview
- Package references for agents: node_modules/@elata-biosciences/<package>/llms.txt

## Packages
- @elata-biosciences/rppg-web: camera heart rate (use createRppgSession)
- @elata-biosciences/eeg-web + eeg-web-ble: EEG over Web Bluetooth (Muse built in)
- @elata-biosciences/ppg-web: headband PPG heart rate and HRV
- @elata-biosciences/biosignal-session / biosignal-analytics: recording and analysis (not yet on npm)
- @elata-biosciences/app-payments: in-app purchases (Elata checkout)
- @elata-biosciences/app-state: per-user key-value storage (not yet on npm; use the elata:state:* messages)
- @elata-biosciences/app-metrics: event records, scores, reportAffect

## Elata rules
- The build must actually use an Elata sensor SDK (rPPG, EEG, or PPG), or upload fails.
- Ship a zip with index.html at the root; use relative asset URLs.
- Never handle wallets, payments, or sessions in the app. Use app-payments for purchases.
- Never send raw camera frames, audio, or raw biosignals off the device.
- Never access window.parent beyond postMessage.
- Put the release version in public/elata.json: { "version": "x.y.z" }.

## Commands
- npm run dev        start the dev server
- npm run build:zip  build and write app.zip for upload
```

***

## Useful prompts

### Start a new app

```text theme={null}
Scaffold a new camera heart-rate app with
npm create @elata-biosciences/elata-demo my-app -- --template rppg
and explain the project structure.
```

### Add the SDK to an existing app

```text theme={null}
Add camera heart rate with @elata-biosciences/rppg-web. Use createRppgSession,
show signal quality, and stop the camera when the component unmounts.
Read node_modules/@elata-biosciences/rppg-web/llms.txt first.
```

### Add a purchase

```text theme={null}
Add a "Pro theme" unlock with @elata-biosciences/app-payments. Gate the UI on
getOwnedItems(), branch on result.status (not txHash), and re-apply owned
benefits on startup.
```

### Save progress

```text theme={null}
Persist the player's settings and best score with Elata's elata:state:get/set messages.
Fall back to localStorage when Elata replies with not_authenticated.
```

### Prepare an upload

```text theme={null}
Check that this build is ready for Elata: index.html at the zip
root, relative asset paths, SDK usage present, and public/elata.json with the
version from package.json. Then run npm run build:zip.
```

***

## Tips

> [!TIP]
>
> Point the assistant at a package's `llms.txt` in `node_modules` before asking
> it to write integration code. These files are written for AI tools and list
> the supported APIs and common mistakes.

* Start from a `create-elata-demo` template, then iterate.
* Test in Elata's play window before submitting. The sandbox behaves differently from `localhost`.

***

## Next

> [card] [Builder Overview](https://docs.elata.bio/apps/build/overview.md)
>
> How publishing works

> [card] [SDK Overview](https://docs.elata.bio/sdk/overview.md)
>
> The Elata SDK packages


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