This repository contains the source code for the demo of Dynamsoft Barcode Reader JavaScript Edition (DBRJS). You can try the demo from this link: https://demo.dynamsoft.com/barcode-reader-js/.
NOTE
A big part of the source code is dedicated to making a better UI or creating better user experience for demoing purposes, which might be distracting if you intend to learn about the SDK and its basic usage.
We recommend that you instead try the samples in the DBRJS samples repository https://github.com/Dynamsoft/barcode-reader-javascript-samples.
The demo itself is based on Vue 2, you can find a simple Vue 2 sample at https://github.com/Dynamsoft/barcode-reader-javascript-samples/tree/main/1.hello-world/5.read-video-vue
If you would like to get this demo project running, you can follow the steps below:
-
Set up
npm install
or
yarn install
-
Add license
If you don't have a license yet, you can request a trial license via Dynamsoft customer portal.
For full functionality, the license must be added in two places.
2.1. Open "src/dbr.js" and add your license key in this line:
BarcodeReader.license = "YOUR-LICENSE-KEY";
2.2. Open "src/dcp.js" and add your license key in this line:
Skip this step if you don't need to read driver's licenses.
CodeParser.license = "YOUR-LICENSE-KEY";
-
Run
For development:
npm run serve
or
yarn serve
For production:
npm run build
or
yarn build
If you have any questions with these samples, feel free to submit an issue or contact us.