{
  "markdown": "# beacio SDK\n\nWeb Bluetooth SDK for iOS Safari. Scan, connect, and talk to BLE devices from any web app.\n\n## Packages\n\n| Package | Purpose | Size |\n|---------|---------|------|\n| [`@beacio/core`](packages/core) | BLE scanning, connecting, GATT read/write/subscribe | ~4KB gzip |\n| [`@beacio/core/detect`](packages/core/detect) | iOS extension detection + install banner | ~2KB gzip |\n| [`@beacio/core/profiles`](packages/core/src/profiles) | Typed BLE profiles (heart rate, battery, etc.) | Optional |\n| [`@beacio/react`](packages/react-sdk) | React hooks (`useDevice`, `useCharacteristic`) | Optional |\n| [`@beacio/mcp`](packages/mcp) | MCP server for AI coding agents + the `beacio` scaffolding CLI (`npx beacio init`) | Optional |\n\n## Quick Start\n\n```bash\nnpm install @beacio/core\n```\n\n```typescript\nimport { initBeacio, isIOSSafari } from '@beacio/core/detect';\nimport { beacio, BeacioError } from '@beacio/core';\n\n// 1. On iOS Safari, detect the extension and prompt install if missing\nif (isIOSSafari()) {\n  await initBeacio({\n    operatorName: 'MyApp',\n    banner: { mode: 'sheet' },\n    onReady: () => console.log('Extension ready'),\n  });\n}\n\n// 2. Scan and connect (works on iOS Safari + Chrome + Edge)\nconst ble = new beacio();\nconst device = await ble.requestDevice({\n  filters: [{ services: ['heart_rate'] }],\n});\n\nawait device.connect();\n\n// 3. Read a value\nconst value = await device.read('heart_rate', 'heart_rate_measurement');\nconsole.log('Heart rate:', value.getUint8(1));\n\n// 4. Subscribe to notifications\nconst unsub = device.subscribe('heart_rate', 'heart_rate_measurement', (v) => {\n  console.log('Heart rate:', v.getUint8(1));\n});\n\n// 5. Clean up\nunsub();\nawait device.disconnect();\n```\n\nFor plain HTML (no bundler):\n\n```html\n<script src=\"https://beacio.com/beacio.js\"></script>\n```\n\n## Error Handling\n\nAll errors are `BeacioError` instances with a typed `code` and a human-readable `suggestion`:\n\n```typescript\ntry {\n  const device = await ble.requestDevice({\n    filters: [{ services: ['heart_rate'] }],\n  });\n  await device.connect();\n} catch (err) {\n  if (err instanceof BeacioError) {\n    console.log(err.code);       // e.g. 'DEVICE_NOT_FOUND'\n    console.log(err.suggestion); // 'No matching devices in range'\n  }\n}\n```\n\n## AI Agent Integration\n\nMCP server for coding agents (Claude Code, Cursor, Copilot):\n\n```\nnpx -y @beacio/mcp\n```\n\nFull SDK reference for LLM context: <https://beacio.com/llms-full.txt>\n\n## Documentation\n\nEach package has its own README with full API reference:\n\n- [SDK wiki](https://github.com/wklm/beacio-sdk/wiki) -- curated getting-started guides, troubleshooting, and background sync usage\n- [`@beacio/core` README](packages/core/README.md) -- scanning, connecting, GATT operations, error codes\n- [`@beacio/core/detect` README](packages/core/detect/README.md) -- extension detection, install banners, React provider\n- [`@beacio/react` README](packages/react-sdk/README.md) -- React hooks, provider setup, and UI components\n\n## Wiki\n\n- [Getting Started](https://github.com/wklm/beacio-sdk/wiki/Getting-Started)\n- [Background Sync](https://github.com/wklm/beacio-sdk/wiki/Background-Sync)\n- [Troubleshooting](https://github.com/wklm/beacio-sdk/wiki/Troubleshooting)\n\n## Versioning\n\nEvery package here is released in **lockstep with the beacio iOS app**: the npm\nversion is always identical to the App Store release version.\n\n`@beacio/core@2.1.0` is the JavaScript for beacio **2.1.0** on the App Store —\nthere is no compatibility matrix to consult. The packages are the JS half of a\nnative product (they talk to the Safari Web Extension over a wire whose shape is\nfixed by the shipped app), so a single number describes both halves.\n\nA consequence worth knowing: SDK-only fixes ship with the next app release\nrather than on their own.\n\n## Agent Skills\n\nThis repo also serves the beacio agent skills, indexed in [SKILLS.md](SKILLS.md):\n\n```bash\nnpx skills add https://github.com/wklm/beacio-sdk\n```\n\n## License\n\nProprietary. See individual package licenses.\n",
  "bytes": 4011,
  "sha": "b3be5b5881ceabdb0cb2a0bf394971dfcc04d5894b451befc0edf6953d31b108",
  "repo_slug": "wklm/beacio-sdk",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_com_beacio_mcp_2e135490/readme"
}