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

# Código Claude

> Utilice Claude Code para crear aplicaciones de Elata con Elata SDK y las API de Elata.

<a id="overview" />

## Información general

Claude Code funciona mejor en aplicaciones de Elata cuando sabe cómo funciona Elata: el sandbox, los paquetes SDK y las reglas de carga. Esta página le brinda un archivo de contexto del proyecto para pegar, además de indicaciones para tareas comunes.

***

<a id="setup" />

## Configuración

1. Instale Claude Code siguiendo los [documentos de Claude Code](https://docs.claude.com/en/docs/claude-code/overview).
2. Abra una terminal en su proyecto y ejecute `claude`.
3. Agregue un archivo `CLAUDE.md` en la raíz de su proyecto con el contexto a continuación.

***

<a id="project-context" />

## Contexto del proyecto

Guarde esto como `CLAUDE.md` en la raíz de su proyecto:

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

***

<a id="useful-prompts" />

## Indicaciones útiles

<a id="start-a-new-app" />

### Iniciar una nueva aplicación

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

<a id="add-the-sdk-to-an-existing-app" />

### Agregar el SDK a una aplicación existente

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

<a id="add-a-purchase" />

### Añadir una compra

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

<a id="save-progress" />

### Guardar progreso

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

<a id="prepare-an-upload" />

### Preparar una carga

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

***

<a id="tips" />

## Consejos

<Tip>
  Apunte al asistente al `llms.txt` de un paquete en `node_modules` antes de pedirle que escriba el código de integración. Estos archivos están escritos para herramientas de inteligencia artificial y enumeran las API compatibles y los errores comunes.
</Tip>

* Comience desde una plantilla `create-elata-demo` y luego repita.
* Pruebe en la ventana de juego de Elata antes de enviarlo. La zona de pruebas se comporta de manera diferente a `localhost`.

***

<a id="next" />

## Siguiente

<CardGroup cols={2}>
  <Card title="Descripción general del constructor" icon="hammer" href="/es/apps/build/overview">
    Cómo funciona la publicación
  </Card>

  <Card title="Descripción general del SDK" icon="brain" href="/es/sdk/overview">
    Los paquetes del SDK de Elata
  </Card>
</CardGroup>


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