@elata-biosciences/eeg-web-ble.
Use this when your app needs real headset data in Chrome or Edge.
Before You Start
You need:- Chrome or Edge
https://orlocalhost- Bluetooth enabled on the machine
- a supported Muse-compatible device
@elata-biosciences/eeg-webinstalled alongside@elata-biosciences/eeg-web-ble
What You Will Build
You will:- install the BLE transport package
- create a
BleTransport - subscribe to frame and status events
- connect and start streaming
Step 1: Install The Packages
Step 2: Create A Transport Module
athenaDecoderFactory up front:
- it keeps Athena-compatible devices working
- it uses the supported decoder path from
@elata-biosciences/eeg-web - it avoids a common failure mode later when testing across device variants
Step 3: Connect From A User Gesture
Browser BLE connection prompts usually need a user gesture such as a button click.connectHeadband() from a click handler in your UI.
startStreaming() is the recommended default because it handles the common
connect() plus start() sequence in one call and avoids a frequent mistake
where apps connect successfully but never actually begin streaming.
Step 4: Turn Frames Into App State
OnceonFrame starts firing, move the data into your own app state instead of
leaving it only in console.log.
The usual pattern is:
- receive
HeadbandFrameV1frames - extract EEG samples or metadata
- compute or forward the values your app cares about
- render charts, scores, or adaptation logic
Step 5: Clean Up On Route Or Component Exit
When the current view is leaving, stop streaming so later reconnect attempts start from a clean state:connect() and start() separately. The tutorial uses startStreaming()
because it is the safest default for most app integrations.
Step 6: Handle Browser And Platform Constraints
If the chooser never appears ornavigator.bluetooth is missing, check these
first:
- the page is running on
https://orlocalhost - you are using Chrome or Edge
- Bluetooth is enabled
- the target device is powered on and available
Athena And Classic Devices
This repo supports:- Muse 2 and Muse S classic BLE devices
- Muse S Athena protocol v2 devices
athenaDecoderFactory is the simplest supported way to keep both
flows covered.
Common Problems
navigator.bluetoothis undefined: unsupported browser or insecure context- No device chooser appears: Bluetooth disabled or page not running on a secure origin
- Athena decoding fails: make sure you passed
athenaDecoderFactory - You need Safari or iOS support: this browser package is not the right path; use a native or bridge strategy
Next Steps
- EEG transport reference: eeg-web-ble
- EEG runtime reference: eeg-web
- Overview guide: Web Bluetooth With Supported Devices