{"id":30348965,"url":"https://github.com/reelyactive/webble","last_synced_at":"2025-08-18T19:45:07.503Z","repository":{"id":290401463,"uuid":"956579139","full_name":"reelyactive/webble","owner":"reelyactive","description":"Client-side utility to facilitate pairing and exchanging data with BLE devices using the Web Bluetooth API.  We believe in an open Internet of Things.","archived":false,"fork":false,"pushed_at":"2025-04-28T16:06:35.000Z","size":271,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-28T17:24:18.843Z","etag":null,"topics":["web-bluetooth","web-bluetooth-api"],"latest_commit_sha":null,"homepage":"https://reelyactive.github.io/webble","language":"JavaScript","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/reelyactive.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2025-03-28T13:49:16.000Z","updated_at":"2025-04-28T16:06:39.000Z","dependencies_parsed_at":"2025-04-28T17:34:28.013Z","dependency_job_id":null,"html_url":"https://github.com/reelyactive/webble","commit_stats":null,"previous_names":["reelyactive/webble"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/reelyactive/webble","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fwebble","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fwebble/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fwebble/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fwebble/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reelyactive","download_url":"https://codeload.github.com/reelyactive/webble/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reelyactive%2Fwebble/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271050819,"owners_count":24691184,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["web-bluetooth","web-bluetooth-api"],"created_at":"2025-08-18T19:45:04.523Z","updated_at":"2025-08-18T19:45:07.482Z","avatar_url":"https://github.com/reelyactive.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"webble\n======\n\n__webble__ is a client-side utility which facilitates pairing and exchanging data with BLE devices using the Web Bluetooth API.\n\n![Overview of webble.js](https://reelyactive.github.io/webble/images/overview.png)\n\n__webble__ is lightweight client-side JavaScript that runs in the browser.  See a live demo using the code in this repository at: [reelyactive.github.io/webble](https://reelyactive.github.io/webble)\n\n\nHello webble!\n-------------\n\nInclude in an _index.html_ file the __webble.js__ script:\n\n```html\n\u003chtml\u003e\n  \u003chead\u003e\u003c/head\u003e\n  \u003cbody\u003e\n    \u003cbutton id=\"startbutton\"\u003e Start \u003c/button\u003e\n    \u003cscript src=\"js/webble.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"js/app.js\"\u003e\u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\nInclude in a _js/app.js_ the code to connect to a Bluetooth Low Energy device using webble:\n\n```javascript\nconst REQUEST_OPTIONS = { acceptAllDevices: true };\nstartbutton.addEventListener('click', () =\u003e {\n  webble.requestDeviceAndConnect(REQUEST_OPTIONS, (error) =\u003e {\n    /* Read and write characteristics, etc. */\n  });\n});\n```\n\nOpen the _index.html_ file in a web browser and click Start for __webble__ to begin scanning for Bluetooth Low Energy devices in range.\n\n\nSupported functions\n-------------------\n\n__webble__ supports the following functions which are essentially convenience wrappers around a subset of the Web Bluetooth API methods, using callbacks rather than Promises.\n\n### isAvailable\n\n```javascript\nwebble.isAvailable((isAvailable) =\u003e {\n  if(isAvailable) { /* Web Bluetooth is supported by this browser */ }\n  else { /* Web Bluetooth is NOT supported by this browser */ }\n});\n```\n\n### requestDeviceAndConnect\n\n```javascript\nconst REQUEST_OPTIONS = { /* See below */ };\nwebble.requestDeviceAndConnect(REQUEST_OPTIONS, (error) =\u003e {\n  if(error) { /* The connection was unsuccessful */ }\n  else { /* webble.device is connected */ }\n});\n```\n\nFor a complete definition of REQUEST_OPTIONS, see the [MDN web docs for requestDevice()](https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/requestDevice#parameters).\n\n### on\n\n```javascript\nwebble.on('connect', (device) =\u003e {});\nwebble.on('disconnect', () =\u003e {});\n```\n\n### discoverServicesAndCharacteristics\n\n```javascript\nwebble.discoverServicesAndCharacteristics((error) =\u003e {\n  if(!error) {\n    /* webble.device.services and webble.device.characteristics populated */\n  }\n});\n```\n\n### readCharacteristic\n\n```javascript\nlet uuid = '6e400001-b5a3-f393-e0a9-e50e24dcca9e';\nwebble.readCharacteristic(uuid, (error, value) =\u003e {\n  if(!error) { /* value is a DataView */ }\n});\n```\n\n### writeCharacteristic\n\n```javascript\nlet uuid = '6e400001-b5a3-f393-e0a9-e50e24dcca9e';\nlet value = Uint8Array.of(123); // Value must be a typed array\nwebble.writeCharacteristic(uuid, value, (error) =\u003e {\n  if(!error) { /* Characteristic write successful */ }\n});\n```\n\n### disconnect\n\n```javascript\nwebble.disconnect();\n```\n\n\nSupported variables\n-------------------\n\n| Variable        | Type   | Description                                      |\n|:----------------|:-------|:-------------------------------------------------|\n| `webble.device` | Object | Subset of BluetoothDevice, adding services \u0026 characteristics, each as a Map |\n\n\nContributing\n------------\n\nDiscover [how to contribute](CONTRIBUTING.md) to this open source project which upholds a standard [code of conduct](CODE_OF_CONDUCT.md).\n\n\nSecurity\n--------\n\nConsult our [security policy](SECURITY.md) for best practices using this open source software and to report vulnerabilities.\n\n\nLicense\n-------\n\nMIT License\n\nCopyright (c) 2025 [reelyActive](https://www.reelyactive.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, \nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE \nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER \nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, \nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN \nTHE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freelyactive%2Fwebble","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freelyactive%2Fwebble","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freelyactive%2Fwebble/lists"}