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

# EEG Web — Getting Started

> Install and initialize the @elata-biosciences/eeg-web WASM package

## Installation

```bash theme={null}
pnpm add @elata-biosciences/eeg-web
```

Requirements: Node.js 18+, browser with WebAssembly support.

***

## WASM Initialization

Before using any signal processing or model APIs, initialize the WASM module:

```typescript theme={null}
import { initEegWasm } from "@elata-biosciences/eeg-web";

await initEegWasm();
```

`initEegWasm` is idempotent — calling it multiple times returns the same promise. For synchronous initialization (e.g., in a Web Worker):

```typescript theme={null}
import { initEegWasmSync } from "@elata-biosciences/eeg-web";

initEegWasmSync(wasmModule);
```

***

## Basic Usage

Compute band powers from EEG data:

```typescript theme={null}
import { initEegWasm, band_powers } from "@elata-biosciences/eeg-web";

await initEegWasm();

const sampleRate = 256;
const eegSamples = new Float64Array(/* ... your EEG data ... */);

const powers = band_powers(eegSamples, sampleRate);
console.log("Alpha:", powers.alpha);
console.log("Beta:", powers.beta);
console.log("Theta:", powers.theta);
console.log("Delta:", powers.delta);
console.log("Gamma:", powers.gamma);
```

***

## Package Structure

`@elata-biosciences/eeg-web` is a thin TypeScript wrapper around WASM bindings generated by `wasm-bindgen`:

* `initEegWasm` / `initEegWasmSync` — WASM initialization helpers
* Headband frame types — normalized data schema for EEG transports
* All WASM APIs — re-exported from the generated bindings

The full API surface includes signal processing functions, analysis models, and the Athena decoder. See the following pages for details:

<CardGroup cols={2}>
  <Card title="Signal Processing" icon="wave-square" iconType="light" href="/sdk/eeg-web/signal-processing">
    Band powers, FFT, spectrum analysis
  </Card>

  <Card title="Models" icon="chart-mixed" iconType="light" href="/sdk/eeg-web/models">
    Alpha bump detection, calmness scoring
  </Card>

  <Card title="Headband Transport" icon="signal-stream" iconType="light" href="/sdk/eeg-web/headband-transport">
    Frame schema and transport interface
  </Card>
</CardGroup>
