{"id":28519525,"url":"https://github.com/mgcrea/vision-camera-barcode-scanner","last_synced_at":"2026-03-02T02:35:15.405Z","repository":{"id":197943007,"uuid":"699850722","full_name":"mgcrea/vision-camera-barcode-scanner","owner":"mgcrea","description":"High performance barcode scanner for React Native using VisionCamera","archived":false,"fork":false,"pushed_at":"2025-03-13T20:55:56.000Z","size":3422,"stargazers_count":108,"open_issues_count":9,"forks_count":16,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-09T06:07:56.266Z","etag":null,"topics":["barcode","camera","react-native","vision"],"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/mgcrea.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["mgcrea"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2023-10-03T13:18:55.000Z","updated_at":"2025-05-28T14:30:10.000Z","dependencies_parsed_at":"2023-10-14T19:04:11.093Z","dependency_job_id":"143a4c52-3066-4b3b-bc12-27a3438a5413","html_url":"https://github.com/mgcrea/vision-camera-barcode-scanner","commit_stats":null,"previous_names":["mgcrea/vision-camera-code-scanner","mgcrea/vision-camera-barcode-scanner"],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/mgcrea/vision-camera-barcode-scanner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgcrea%2Fvision-camera-barcode-scanner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgcrea%2Fvision-camera-barcode-scanner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgcrea%2Fvision-camera-barcode-scanner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgcrea%2Fvision-camera-barcode-scanner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mgcrea","download_url":"https://codeload.github.com/mgcrea/vision-camera-barcode-scanner/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mgcrea%2Fvision-camera-barcode-scanner/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260248880,"owners_count":22980738,"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","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":["barcode","camera","react-native","vision"],"created_at":"2025-06-09T06:07:22.527Z","updated_at":"2026-03-02T02:35:15.370Z","avatar_url":"https://github.com/mgcrea.png","language":"TypeScript","funding_links":["https://github.com/sponsors/mgcrea"],"categories":[],"sub_categories":[],"readme":"# vision-camera-barcode-scanner\n\n\u003c!-- markdownlint-disable MD033 --\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://mgcrea.github.io/vision-camera-barcode-scanner\"\u003e\n    \u003cimg src=\"./.github/assets/logo.png\" alt=\"logo\" width=\"320\" height=\"200\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@mgcrea/vision-camera-barcode-scanner\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/@mgcrea/vision-camera-barcode-scanner.svg?style=for-the-badge\" alt=\"npm version\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@mgcrea/vision-camera-barcode-scanner\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dt/@mgcrea/vision-camera-barcode-scanner.svg?style=for-the-badge\" alt=\"npm total downloads\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@mgcrea/vision-camera-barcode-scanner\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dm/@mgcrea/vision-camera-barcode-scanner.svg?style=for-the-badge\" alt=\"npm monthly downloads\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@mgcrea/vision-camera-barcode-scanner\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/l/@mgcrea/vision-camera-barcode-scanner.svg?style=for-the-badge\" alt=\"npm license\" /\u003e\n  \u003c/a\u003e\n  \u003cbr /\u003e\n  \u003ca href=\"https://github.com/mgcrea/vision-camera-barcode-scanner/actions/workflows/main.yml\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/mgcrea/vision-camera-barcode-scanner/main.yml?style=for-the-badge\u0026branch=master\" alt=\"build status\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://depfu.com/github/mgcrea/vision-camera-barcode-scanner\"\u003e\n    \u003cimg src=\"https://img.shields.io/depfu/dependencies/github/mgcrea/vision-camera-barcode-scanner?style=for-the-badge\" alt=\"dependencies status\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003c!-- markdownlint-enable MD037 --\u003e\n\n## Features\n\nHigh performance barcode scanner for React Native using VisionCamera.\n\n- **Modern and future-proof:** Built on [react-native-vision-camera](https://github.com/mrousavy/react-native-vision-camera) with minimal native dependencies for each platforms to minimize future build-failure risk.\n\n- **Minimal footprint:** Leverages [Google's MLKit BarcodeScanner](https://developers.google.com/android/reference/com/google/mlkit/vision/barcode/package-summary) on Android and [Apple's Vision VNDetectBarcodesRequest](https://developer.apple.com/documentation/vision/vndetectbarcodesrequest).\n\n- **Powerful \u0026 Performant:** The implementation has been tailored for advanced use cases where performance is critical. Scanning barcodes is butter smooth at 30fps, and you can customize the detection speed loop (detection fps).\n\n- **Hooks based:** Exposes easy-to-use hooks [`useBarcodeScanner`](./src/hooks/useBarcodeScanner.ts) to quickly get started\n\n\u003c!-- Check the [**Documentation**](https://mgcrea.github.io/vision-camera-barcode-scanner/) for usage details. --\u003e\n\n## Demo\n\n![demo](./.github/assets/demo.gif)\n\nA working project can be found at [vision-camera-barcode-scanner-example](./example)\n\n## Install\n\n\u003e [!WARNING]\n\u003e The project is currently trying to closely track the [react-native-vision-camera v4](https://github.com/mrousavy/react-native-vision-camera/releases),\n\u003e The latest 0.11+ releases are made to work with the latest react-native-vision-camera release only (currently 4.0.0)\n\n```bash\nnpm install @mgcrea/vision-camera-barcode-scanner\n# or\nyarn add @mgcrea/vision-camera-barcode-scanner\n# or\npnpm add @mgcrea/vision-camera-barcode-scanner\n```\n\n### Dependencies\n\nThis package relies on:\n\n- [react-native-vision-camera@\u003e=3](https://github.com/mrousavy/react-native-vision-camera)\n- [react-native-worklets-core](https://github.com/margelo/react-native-worklets-core)\n\nYou must add them as dependencies to your project:\n\n```bash\nnpm install react-native-vision-camera react-native-worklets-core\n# or\nyarn add react-native-vision-camera react-native-worklets-core\n# or\npnpm add react-native-vision-camera react-native-worklets-core\n```\n\nThen you must follow their respective installation instructions:\n\n- [react-native-worklets-core](https://github.com/margelo/react-native-worklets-core#installation)\n\n## Quickstart\n\n```tsx\nimport {\n  CameraHighlights,\n  useBarcodeScanner,\n} from \"@mgcrea/vision-camera-barcode-scanner\";\nimport type { FunctionComponent } from \"react\";\nimport { StyleSheet } from \"react-native\";\n\nexport const App: FunctionComponent = () =\u003e {\n  // @NOTE you must properly ask for camera permissions first!\n  // You should use `PermissionsAndroid` for Android and `Camera.requestCameraPermission()` on iOS.\n\n  const { props: cameraProps, highlights } = useBarcodeScanner({\n    fps: 5,\n    barcodeTypes: [\"qr\", \"ean-13\"], // optional\n    onBarcodeScanned: (barcodes) =\u003e {\n      \"worklet\";\n      console.log(\n        `Scanned ${barcodes.length} codes with values=${JSON.stringify(\n          barcodes.map(({ value }) =\u003e value),\n        )} !`,\n      );\n    },\n  });\n\n  const devices = useCameraDevices();\n  const device = devices.find(({ position }) =\u003e position === \"back\");\n  const format = useCameraFormat(device, [\n    { videoResolution: { width: 1920, height: 1080 } },\n  ]);\n  if (!device) {\n    return null;\n  }\n\n  return (\n    \u003cView style={{ flex: 1 }}\u003e\n      \u003cCamera\n        style={StyleSheet.absoluteFill}\n        device={device}\n        isActive\n        {...cameraProps}\n      /\u003e\n      \u003cCameraHighlights highlights={highlights} color=\"peachpuff\" /\u003e\n    \u003c/View\u003e\n  );\n};\n```\n\n## Credits\n\nInspired by:\n\n- [rodgomesc/vision-camera-code-scanner](https://github.com/rodgomesc/vision-camera-code-scanner)\n\n## Authors\n\n- [Olivier Louvignes](https://github.com/mgcrea) \u003c\u003colivier@mgcrea.io\u003e\u003e\n\n## License\n\n```txt\nThe MIT License\n\nCopyright (c) 2023 Olivier Louvignes \u003colivier@mgcrea.io\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall 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.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgcrea%2Fvision-camera-barcode-scanner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmgcrea%2Fvision-camera-barcode-scanner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmgcrea%2Fvision-camera-barcode-scanner/lists"}