Runtime example
Use the Runtime package (@hangtime/grip-connect-runtime) from Node.js, Bun, or Deno for scripts, data logging, or headless testing.
Source
Stack
Pattern
- Import the device class from
@hangtime/grip-connect-runtime. - Create the device, set
notify()(and optionallyactive()). - Call
connect(onSuccess, onError)and inside the success callback usestream(),battery(),download(), etc. - Run the script on a machine with Bluetooth and a paired/supported device.
See Platforms: Runtime for install and usage notes, or Platforms: CLI for the ready-made command-line tool.
Run
From the repo root:
sh
npm install
npm run start --workspace ./examples/runtimeEnsure Bluetooth is available and the device is in range.