{"id":29995529,"url":"https://github.com/benjamin-stefan/ant-plus-next","last_synced_at":"2026-03-13T09:32:00.469Z","repository":{"id":255412701,"uuid":"849246809","full_name":"Benjamin-Stefan/ant-plus-next","owner":"Benjamin-Stefan","description":"A modern Node.js library for interacting with ANT+ USB sticks and sensors. Supports both Node.js (USB) and WebUSB (browser) for heart rate monitors, speed sensors, and more.","archived":false,"fork":false,"pushed_at":"2026-01-23T09:30:29.000Z","size":3112,"stargazers_count":7,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-23T10:37:54.636Z","etag":null,"topics":["ant","ant-plus","ant-plus-next","garmin","usb","webusb"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Benjamin-Stefan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-08-29T08:48:10.000Z","updated_at":"2026-01-23T09:30:24.000Z","dependencies_parsed_at":"2024-08-29T21:29:42.232Z","dependency_job_id":"8c236b7e-e4e0-4ea0-bc7e-301b235a85f9","html_url":"https://github.com/Benjamin-Stefan/ant-plus-next","commit_stats":null,"previous_names":["benjamin-stefan/ant-plus-next"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/Benjamin-Stefan/ant-plus-next","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Benjamin-Stefan%2Fant-plus-next","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Benjamin-Stefan%2Fant-plus-next/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Benjamin-Stefan%2Fant-plus-next/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Benjamin-Stefan%2Fant-plus-next/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Benjamin-Stefan","download_url":"https://codeload.github.com/Benjamin-Stefan/ant-plus-next/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Benjamin-Stefan%2Fant-plus-next/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30464650,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T06:34:02.089Z","status":"ssl_error","status_checked_at":"2026-03-13T06:33:49.182Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ant","ant-plus","ant-plus-next","garmin","usb","webusb"],"created_at":"2025-08-05T01:42:17.509Z","updated_at":"2026-03-13T09:32:00.447Z","avatar_url":"https://github.com/Benjamin-Stefan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ant-plus-next\n\n[![npm version](https://img.shields.io/npm/v/ant-plus-next)](https://www.npmjs.com/package/ant-plus-next)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/Benjamin-Stefan/ant-plus-next/ci.yml?branch=main)](https://github.com/Benjamin-Stefan/ant-plus-next/actions/workflows/ci.yml)\n[![License](https://img.shields.io/github/license/Benjamin-Stefan/ant-plus-next)](https://github.com/Benjamin-Stefan/ant-plus-next/blob/main/LICENSE)\n[![Issues](https://img.shields.io/github/issues/Benjamin-Stefan/ant-plus-next)](https://github.com/Benjamin-Stefan/ant-plus-next/issues)\n\nA modern Node.js module for interacting with ANT+ USB sticks and sensors. It provides a user-friendly API for heart rate monitors, speed sensors, and more, supporting both Node.js USB and WebUSB (browser) for maximum flexibility in various environments.\n\n## 🚀 Features\n\n-   🖥️ Cross-platform: Supports Linux, Windows, macOS, and WebUSB (browser).\n-   🔗 Node.js USB and WebUSB (browser) compatibility for a variety of environments.\n-   🏃‍♂️ Easy interaction with heart rate, speed, and power sensors.\n-   📦 Simple npm installation and intuitive API.\n\n## 📋 Table of Contents\n\n-   [About](#about)\n-   [Prerequisites](#prerequisites)\n-   [Installation](#installation)\n-   [Migration from ant-plus](#migration-from-ant-plus)\n-   [Usage](#usage)\n-   [Important Notes](#important-notes)\n-   [API Documentation](#api-documentation)\n-   [Examples](#examples)\n-   [Contributing](#contributing)\n-   [License](#license)\n\n## 🛠️ About\n\n`ant-plus-next` is a versatile Node.js library designed for interacting with ANT+ USB sticks and sensors. The library supports **both Node.js (via USB)** and **WebUSB (browser)**, making it easy to integrate with devices like heart rate monitors, speed sensors, and power meters, whether you're building a server-side application or a browser-based solution.\n\nWith multi-platform compatibility (Linux, Windows, macOS, and browser), `ant-plus-next` allows seamless access to ANT+ sensor data, regardless of whether you're building a server-side application or an in-browser solution for data acquisition.\n\n## 📦 Prerequisites\n\nBefore installing the module, ensure the following prerequisites are met:\n\n### Linux\n\nMake sure `libusb` is installed. You can install `libusb` and other required packages using:\n\n```sh\nsudo apt-get install build-essential libudev-dev\n```\n\n### WIndows\n\nUse [Zadig](https://zadig.akeo.ie/) to install the WinUSB driver for your USB device. Otherwise, you will get `LIBUSB_ERROR_NOT_SUPPORTED` when attempting to open devices.\n\n### macOS\n\nEnsure that Garmin Express is not running, as it will attach to the ANT+ stick and prevent this module from accessing it.\n\n### Browser (WebUSB)\n\nTo use WebUSB in a browser, ensure the following conditions are met:\n\n-   WebUSB is supported in **Google Chrome** (version 61 or higher) and other Chromium-based browsers like **Microsoft Edge**.\n-   WebUSB is **not supported in Firefox** or **Safari**.\n-   You must serve your web app over **HTTPS**, as WebUSB only works in secure contexts.\n-   Users must grant explicit access to the USB device using the browser's permission prompt.\n\n## ⚙️ Installation\n\nInstall the module via npm:\n\n```sh\nnpm install ant-plus-next\n```\n\n## 🔄 Migration from `ant-plus`\n\n-   Change variable `DeviceID` to `DeviceId`\n-   Renamed method `attach` to `attachSensor` in `BaseSensor`, `AntPlusBaseSensor`, `AntPlusScanner`, `AntPlusSensor`\n-   Update the constructor of `GarminStick2` and `GarminStick3` from `constructor(dbgLevel = 0)` to `debugOptions: DebugOptions = {}`.\n-   Change event `hbData` to `heartRateData` from Heart rate sensor\n-   Various other small, insignificant changes were made.\n\nIf you encounter any issues, please check the [Usage](#usage) or [Examples](#examples). If the problem persists, feel free to open an issue.\n\n## 🚀 Usage\n\nHere’s a quick guide to get you started with the `ant-plus-next` module:\n\n### For Node.js\n\n1. Create USB Stick Instance\n\n    ```javascript\n    import * as Ant from \"ant-plus-next\";\n    const stick = new Ant.GarminStick3();\n    ```\n\n2. Create and configure a sensor:\n\n    ```javascript\n    const heartRateSensor = new Ant.HeartRateSensor(stick);\n    ```\n\n3. Attach event listeners:\n\n    ```javascript\n    heartRateSensor.on(\"heartRateData\", (data) =\u003e {\n        console.log(`Device Id: ${data.DeviceId}, Heart Rate: ${data.ComputedHeartRate}`);\n    });\n    ```\n\n4. Open the USB stick and start scanning:\n\n    ```javascript\n    stick.on(\"startup\", () =\u003e {\n        heartRateSensor.attachSensor(0, 0);\n    });\n\n    const result = await stick.open();\n    if (!result) {\n        console.error(\"Stick not found!\");\n    }\n    ```\n\n### For WebUSB (browser)\n\n1. Create WebUSB Stick Instance\n\n    ```javascript\n    import * as Ant from \"ant-plus-next\";\n    const webUsbStick = new Ant.WebUsbStick();\n    ```\n\n2. Create and configure a sensor:\n\n    ```javascript\n    const heartRateSensor = new Ant.HeartRateSensor(webUsbStick);\n    ```\n\n3. Attach event listeners:\n\n    ```javascript\n    heartRateSensor.on(\"heartRateData\", (data) =\u003e {\n        console.log(`Device Id: ${data.DeviceId}, Heart Rate: ${data.ComputedHeartRate}`);\n    });\n    ```\n\n4. Open the WebUSB stick and start scanning:\n\n    ```javascript\n    webUsbStick.on(\"startup\", () =\u003e {\n        heartRateSensor.attachSensor(0, 0);\n    });\n\n    const result = await webUsbStick.open();\n    if (!result) {\n        console.error(\"WebUSB Stick not found!\");\n    }\n    ```\n\n## ⚠️ Important Notes\n\n-   Never attach a sensor before receiving the `startup` event.\n-   Never attach a new sensor before receiving the `attached` or `detached` event of the previous sensor.\n-   Never detach a sensor before receiving the `attached` or `detached` event of the previous sensor.\n\n## 📖 API Documentation\n\nFor detailed API documentation, visit the [TypeDoc-generated documentation](https://benjamin-stefan.github.io/ant-plus-next/).\n\n## 🧪 Examples\n\nExplore more examples in the [examples](/examples) folder.\n\n### Example: Heart Rate Sensor for Node.js\n\n```javascript\nimport * as Ant from \"ant-plus-next\";\nconst stick = new Ant.GarminStick3();\nconst heartRateSensor = new Ant.HeartRateSensor(stick);\n\nheartRateSensor.on(\"heartRateData\", (data) =\u003e {\n    console.log(`Device Id: ${data.DeviceId}, Heart Rate: ${data.ComputedHeartRate}`);\n});\n\nstick.on(\"startup\", () =\u003e {\n    heartRateSensor.attachSensor(0, 0);\n});\n\nconst result = await stick.open();\nif (!result) {\n    console.error(\"Stick not found!\");\n}\n```\n\n### Example: Heart Rate Sensor for WebUSB (browser)\n\n```javascript\nimport * as Ant from \"ant-plus-next\";\nconst webUsbStick = new Ant.WebUsbStick();\nconst heartRateSensor = new Ant.HeartRateSensor(webUsbStick);\n\nheartRateSensor.on(\"heartRateData\", (data) =\u003e {\n    console.log(`Device Id: ${data.DeviceId}, Heart Rate: ${data.ComputedHeartRate}`);\n});\n\nwebUsbStick.on(\"startup\", () =\u003e {\n    heartRateSensor.attachSensor(0, 0);\n});\n\nconst result = await webUsbStick.open();\nif (!result) {\n    console.error(\"WebUSB Stick not found!\");\n}\n```\n\n## 🤝 Contributing\n\nContributions are welcome! Please check out the [CONTRIBUTING.md](/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](/CODE_OF_CONDUCT.md) for details.\n\n## 📜 License and Acknowledgements\n\nThis project is licensed under the [MIT License](./LICENSE).\n\nParts of the code are based on the original project [ant-plus](https://github.com/Loghorn/ant-plus) by Alessandro Vergani (© 2015). The original project was also licensed under the MIT License.\n\n### Thanks You!\n\nThanks to the original developers and all contributors!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjamin-stefan%2Fant-plus-next","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenjamin-stefan%2Fant-plus-next","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjamin-stefan%2Fant-plus-next/lists"}