{"_id":"@0xsarwagya/agnostic-web-ble","name":"@0xsarwagya/agnostic-web-ble","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@0xsarwagya/agnostic-web-ble","version":"0.2.0","description":"Bluetooth Low Energy across web runtimes through one consistent API.","type":"module","license":"MIT","repository":{"type":"git","url":"git+https://github.com/0xsarwagya/agnostic-web-ble.git"},"homepage":"https://oss.sarwagya.wtf/agnostic-web-ble","keywords":["bluetooth","ble","web-bluetooth","bluetooth-low-energy","adapter","typescript"],"sideEffects":false,"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./adapters/native":{"types":"./dist/adapters/native.d.ts","import":"./dist/adapters/native.js"},"./adapters/mock":{"types":"./dist/adapters/mock.d.ts","import":"./dist/adapters/mock.js"}},"publishConfig":{"access":"public"},"devDependencies":{"@playwright/test":"1.48.0","@types/node":"^22.15.3","@types/web-bluetooth":"^0.0.21","tsup":"^8.3.5","typescript":"5.9.2","vite":"^5.4.11","vitest":"^3.0.0"},"scripts":{"build":"tsup && tsc -p tsconfig.build.json","check-types":"tsc --noEmit","test":"vitest run","test:unit":"vitest run","test:e2e":"playwright test","test:e2e:mock":"playwright test --project=chromium-mock --project=firefox-mock --project=webkit-mock","test:e2e:native":"playwright test --project=chromium-native","test:e2e:unsupported":"playwright test --project=firefox-unsupported --project=webkit-unsupported","test:e2e:install":"playwright install --with-deps"},"_id":"@0xsarwagya/agnostic-web-ble@0.2.0","bugs":{"url":"https://github.com/0xsarwagya/agnostic-web-ble/issues"},"_integrity":"sha512-yah2efASh5Ke9NIkTdbVno5t797VK8ZFDxMduJCfheqetdsTJgEc3zWOP2v+LcDm8ZfzwYXoG2TsqIV9Bd3/cQ==","_resolved":"/tmp/ead9a431cf199ceec76da94467e34936/0xsarwagya-agnostic-web-ble-0.2.0.tgz","_from":"file:0xsarwagya-agnostic-web-ble-0.2.0.tgz","_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-yah2efASh5Ke9NIkTdbVno5t797VK8ZFDxMduJCfheqetdsTJgEc3zWOP2v+LcDm8ZfzwYXoG2TsqIV9Bd3/cQ==","shasum":"8b8a6b136ce644ca51cd57d036dfde33f6bc9b96","tarball":"https://registry.npmjs.org/@0xsarwagya/agnostic-web-ble/-/agnostic-web-ble-0.2.0.tgz","fileCount":27,"unpackedSize":77131,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIF2lMtZ1nXStXUtVGm+QTyjDsGmFLZqXnIzrvzV4EkDhAiAtuivoF5XSVUTJM+87ygn4+ZbFvFKuX8R4A+CNc5VE9w=="}]},"_npmUser":{"name":"0xsarwagya","email":"sarwagyasingh69@gmail.com"},"directories":{},"maintainers":[{"name":"0xsarwagya","email":"sarwagyasingh69@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/agnostic-web-ble_0.2.0_1783285499793_0.3823903028167952"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-05T21:04:59.613Z","0.2.0":"2026-07-05T21:04:59.951Z","modified":"2026-07-05T21:05:00.156Z"},"maintainers":[{"name":"0xsarwagya","email":"sarwagyasingh69@gmail.com"}],"description":"Bluetooth Low Energy across web runtimes through one consistent API.","homepage":"https://oss.sarwagya.wtf/agnostic-web-ble","keywords":["bluetooth","ble","web-bluetooth","bluetooth-low-energy","adapter","typescript"],"repository":{"type":"git","url":"git+https://github.com/0xsarwagya/agnostic-web-ble.git"},"bugs":{"url":"https://github.com/0xsarwagya/agnostic-web-ble/issues"},"license":"MIT","readme":"# Agnostic Web BLE\n\nBluetooth Low Energy for the web, whatever your browser might be.\n\nA TypeScript library for using Bluetooth Low Energy across web runtimes\nthrough one consistent API. Your application knows the device. The adapter\nknows the runtime.\n\n## Install\n\n```sh\npnpm add @0xsarwagya/agnostic-web-ble\n```\n\n## First connection\n\n```ts\nimport { createBluetooth } from \"@0xsarwagya/agnostic-web-ble\";\nimport { nativeWebBluetoothAdapter } from \"@0xsarwagya/agnostic-web-ble/adapters/native\";\n\nconst bluetooth = createBluetooth({\n  adapters: [nativeWebBluetoothAdapter()],\n});\n\nconst device = await bluetooth.requestDevice({\n  filters: [{ services: [\"180f\"] }],\n});\n\nconst connection = await device.connect();\nconst service = await connection.getPrimaryService(\"180f\");\nconst characteristic = await service.getCharacteristic(\"2a19\");\n\nconst value = await characteristic.readValue();\nconsole.log(\"battery level:\", value.getUint8(0));\n```\n\nNo hardware on hand? The mock adapter runs the same application code\ndeterministically:\n\n```ts\nimport { createMockAdapter } from \"@0xsarwagya/agnostic-web-ble/adapters/mock\";\n\nconst bluetooth = createBluetooth({\n  adapters: [createMockAdapter({ devices: [/* ... */] })],\n});\n```\n\n## Status\n\nBeta. The adapter contract may still change before 1.0.\n\n## Documentation\n\nhttps://oss.sarwagya.wtf/agnostic-web-ble/docs\n\n## License\n\n[MIT](./LICENSE)\n","readmeFilename":"README.md","_rev":"1-ed1f55da1940931158ba4c346aa3e9b7"}