@elata-biosciences/eeg-web to an existing browser application.
Use this when your app needs EEG analysis APIs in the browser.
If you also need live headset transport, you will add
@elata-biosciences/eeg-web-ble after this tutorial.
What You Will Build
You will:- install
@elata-biosciences/eeg-web - initialize the EEG WASM runtime
- run a simple analysis call
- verify your app can serve the packaged WASM assets
Step 1: Install The Package
Step 2: Create A Small EEG Module
Create a small module in your app so the integration stays isolated and easy to test:initEegWasm()should run before using analysis helpers- the module-level Promise avoids repeated initialization, including concurrent calls
- keeping it in one file makes it easier to swap in real samples later
Step 3: Call It From Your UI
For example:Step 4: Verify The WASM Asset Path
Run your app in development and confirm the module initializes without errors. IfinitEegWasm() fails, the most likely problem is that your bundler or app
deployment is not serving the packaged wasm/ assets correctly.
This is the first thing to fix before adding more product logic.
If you are using Vite, the two common fixes are:
- add
vite-plugin-wasmandvite-plugin-top-level-await, then keep usingawait initEegWasm() - import the WASM asset URL directly and pass it to
initEegWasm(wasmUrl)
eeg-web-demo
template before assuming the package itself is broken.
Step 5: Replace Example Data With Real App Data
Once the example call works, swap the placeholder array with actual EEG sample buffers from your app. The common pattern is:- receive or load EEG samples
- normalize them into typed arrays
- call Elata analysis helpers
- map the result into app state, feedback, scoring, or visualizations
When To Add eeg-web-ble
Add @elata-biosciences/eeg-web-ble when you need live browser transport from
a supported Muse-compatible headset.
Do not start there if the plain EEG runtime is not working yet. Get WASM
loading working first, then add transport.
Common Problems
initEegWasm()throws: your app is probably not serving packagedwasm/assets correctly- You expected device discovery:
eeg-webdoes not do Bluetooth transport by itself - You are evaluating the SDK from scratch: start with Build Your First Elata App instead of manual setup
Next Steps
- Add live Muse-compatible transport: Stream Muse-Compatible EEG Over Web Bluetooth
- EEG package reference: eeg-web
- Higher-level integration summary: EEG In A Browser App