{"id":18696302,"url":"https://github.com/dynamsoft/easy-barcode-scanner","last_synced_at":"2026-02-07T10:30:48.027Z","repository":{"id":260057471,"uuid":"859742092","full_name":"Dynamsoft/easy-barcode-scanner","owner":"Dynamsoft","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-22T06:38:14.000Z","size":542,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-09-28T00:43:40.454Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Dynamsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"zenodo":null}},"created_at":"2024-09-19T07:48:25.000Z","updated_at":"2025-08-22T06:38:17.000Z","dependencies_parsed_at":"2024-12-28T03:41:31.217Z","dependency_job_id":"393d2fae-55be-4a7f-88a3-48d7a90f061d","html_url":"https://github.com/Dynamsoft/easy-barcode-scanner","commit_stats":null,"previous_names":["dynamsoft/easy-barcode-scanner"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Dynamsoft/easy-barcode-scanner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dynamsoft%2Feasy-barcode-scanner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dynamsoft%2Feasy-barcode-scanner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dynamsoft%2Feasy-barcode-scanner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dynamsoft%2Feasy-barcode-scanner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dynamsoft","download_url":"https://codeload.github.com/Dynamsoft/easy-barcode-scanner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dynamsoft%2Feasy-barcode-scanner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29192599,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T07:37:03.739Z","status":"ssl_error","status_checked_at":"2026-02-07T07:37:03.029Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":[],"created_at":"2024-11-07T11:18:00.489Z","updated_at":"2026-02-07T10:30:48.022Z","avatar_url":"https://github.com/Dynamsoft.png","language":"TypeScript","readme":"# Easy Barcode Scanner\n\nThe Easy Barcode Scanner is a lightweight, user-friendly wrapper for the Dynamsoft Barcode Reader SDK. It simplifies the barcode scanning process, making it easier to integrate into your web applications with minimal effort.\n\n**Features**\n* Supports video-based barcode scanning\n* Handles multiple barcodes with ease\n* Simple integration with just a few lines of code\n\n## Out-of-the-box Scanning\n\nThe simplest way to use Easy Barcode Scanner requires only one line code to create a video decoding web application.\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@11.0.3000/dist/dbr.bundle.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/gh/Dynamsoft/easy-barcode-scanner@11.0.3003/dist/easy-barcode-scanner.js\"\n  data-license=\"\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  EasyBarcodeScanner.scan().then(txt=\u003ealert(txt)).catch(ex=\u003ealert(ex.message || ex));\n\u003c/script\u003e\n```\n[Source Code \u003e\u003e](https://github.com/Dynamsoft/easy-barcode-scanner/blob/main/index.html) | [Run in github.io \u003e\u003e](https://Dynamsoft.github.io/easy-barcode-scanner/index.html)\n\n![Out-of-the-box Scanning](./out-of-the-box-scan.png)\n\n## Create Your Own Scanner for Further Control\n\nYou can also create your own scanner instance to have more control over the entire workflow. For more details on the encapsulated functionality, refer to `src/index.ts`, and feel free to modify it based on your specific needs.\n\n```html\n\u003cdiv id=\"camera-view-container\" style=\"height:90vh\"\u003e\u003c/div\u003e\n\u003cbutton id=\"btn-scan\"\u003escan\u003c/button\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@11.0.3000/dist/dbr.bundle.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/gh/Dynamsoft/easy-barcode-scanner@11.0.3003/dist/easy-barcode-scanner.js\"\n  data-license=\"\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  let pScanner, scanner;\n  document.getElementById('btn-scan').addEventListener('click', async()=\u003e{\n    try{\n      scanner = await (pScanner || (pScanner = EasyBarcodeScanner.createInstance()));\n      // Optional. Insert the UI into the specified element.\n      // Otherwise the UI will be inserted into `document.body`.\n      document.querySelector(\"#camera-view-container\").append(scanner.getUIElement());\n      scanner.onUniqueRead = (txt) =\u003e { console.log(txt); };\n      await scanner.open();\n    }catch(ex){\n      // If camera doesn't exist or is occupied, the camera may fail to open.\n      // So it's better to use `try-catch`.\n      console.error(ex);\n      alert(ex.message || ex);\n    }\n  });\n\u003c/script\u003e\n```\n\n## How to use it in frameworks like Angular, React, and Vue\n\nTo integrate Easy Barcode Scanner into your framework, follow these steps:\n\n1. Install the necessary package:\n\n```sh\nnpm i dynamsoft-barcode-reader-bundle@11.0.3000 -E\n```\n\n2. Copy the `src/index.ts`, `src/dm-camera.*` from the library into your project. Rename `index.ts` as needed, for example: `[your-path]/easy-barcode-reader.ts.`\n\n**Example 1: Simple Out-of-the-box Scan**\n\nFor a simpler implementation, this example shows how to scan with a single function:\n\n```ts\nimport EasyBarcodeScanner from '[your-path]/easy-barcode-reader';\n\nEasyBarcodeScanner.license = \"\"; // Add your license key here\n\nasync scan(){\n  try{\n    alert(await EasyBarcodeScanner.scan());\n  }catch(ex){\n    console.error(ex);\n    alert(ex.message || ex);\n  }\n}\n```\n\n**Example 2: Setting Up a Scanner**\n\nThis example shows how to create your own barcode scanner, giving you more control over the details:\n\n```tsx\nimport EasyBarcodeScanner from '[your-path]/easy-barcode-reader';\n\nEasyBarcodeScanner.license = \"\"; // Add your license key here\n\nlet pScanner = null;\nlet scanner = null;\n\nasync mount(){\n  try{\n    scanner = await (pScanner || (pScanner = EasyBarcodeScanner.createInstance()));\n    cameraViewContainer.append(scanner.getUIElement()); // Optional.\n    scanner.onUniqueRead = (txt) =\u003e { console.log(txt); };\n    await scanner.open();\n  }catch(ex){\n    console.error(ex);\n    alert(ex.message || ex);\n  }\n}\nbeforeUnmount(){\n  // Clean up to free resources\n  try{ (await pScanner)?.dispose(); }catch(_){}\n}\n\n// usage example in a tsx/jsx component\n\u003cdiv ref={cameraViewContainer}\u003e\u003c/div\u003e\n```\n\n* The `mount()` function initializes the scanner and listens for barcode readings.\n* The `beforeUnmount()` function disposes of the scanner instance to prevent memory leaks.\n\n## Customize the UI\n\nThe built-in UIs are located in files like `xxx.ui.xml`. In fact, it is just HTML, and naming it XML can avoid problems caused by the live server plugin. You can copy `xxx.ui.xml` into your project, modify it as needed, and pass its path to the `createInstance` or `scan` API to use the customized version.\n\n```typescript\n// 'https://cdn.jsdelivr.net/gh/Dynamsoft/easy-barcode-scanner@11.0.3003/easy-barcode-scanner.ui.xml' by default\nEasyBarcodeScanner.scan(ui?: string|HTMLElement);\n// 'https://cdn.jsdelivr.net/gh/Dynamsoft/easy-barcode-scanner@11.0.3003/mobile-native.ui.xml' by default\nEasyBarcodeScanner.createInstance(ui?: string|HTMLElement);\n```\n\n## All supported barcodes\n\nYou can use the code snippet from the [Out-of-the-box Scanning](#out-of-the-box-scanning) section to focus the camera on one or more barcodes. If only one barcode is detected, the result will be displayed immediately. If multiple codes are scanned, an additional interactive step allows you to choose the target.\n\n![default supported barcode](./default-supported-barcode.png)\n\n\u003e Please note that some barcode types are not supported by default for performance concern. Please check [here](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/user-guide/index.html#customize-the-process) to change settings.\n\n## License Information\n\nThe license used in this sample is an automatically requested trial license, only valid for 24 hours and applicable to any newly authorized browser. To test the SDK further, you can request a 30-day free trial license via the \u003ca href=\"https://www.dynamsoft.com/customer/license/trialLicense?ver=11.0.30\u0026utm_source=sampleReadme\u0026product=dbr\u0026package=js\" target=\"_blank\"\u003eRequest a Trial License\u003c/a\u003e link.\n\nThe license can be directly configured within the script tag when including the script file.\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/gh/Dynamsoft/easy-barcode-scanner@11.0.3003/dist/easy-barcode-scanner.js\"\ndata-license=\"[YOUR-LICENSE]\"\u003e\u003c/script\u003e\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdynamsoft%2Feasy-barcode-scanner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdynamsoft%2Feasy-barcode-scanner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdynamsoft%2Feasy-barcode-scanner/lists"}