You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Replace inline Quick Start code with reference to samples/hello-world.html
(CDN-loaded samples work with double-click; local dist/ requires a web server)
- Fix Self-Hosting section: rename to "Deploying to Your Server", fix
engineResourcePaths pointing to CDN instead of local path, provide full
working HTML example with context
- Add CDN vs local guidance: explain standalone/scenario samples (switch
script tag) vs framework samples (update engineResourcePaths)
- Expand RTU acronym, list all 14 frameworks and scenario categories
- Fix secure context note to cover both camera and license
- Fix copyright, capitalization, and formatting nits
# Dynamsoft Barcode Reader JavaScript - ZIP Package Guide
2
2
3
3
Welcome! This package contains all resource files related to **Dynamsoft Barcode Reader JavaScript SDK**, and sample projects demonstrating how to use it.
4
4
@@ -11,11 +11,10 @@ Welcome! This package contains all resource files related to **Dynamsoft Barcode
11
11
When deploying your application / website for production, make sure to serve it via a secure HTTPS connection. This is required for two reasons:
12
12
13
13
- Access to the camera video stream is only granted in a security context. Most browsers impose this restriction.
14
-
15
-
> Some browsers like Chrome may grant the access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.
16
-
17
14
- Dynamsoft License requires a secure context to work.
18
15
16
+
> Some browsers like Chrome may grant access for `http://127.0.0.1` and `http://localhost` or even for pages opened directly from the local disk (`file:///...`). This can be helpful for temporary development and test.
17
+
19
18
### Browser Compatibility
20
19
21
20
The following table is a list of supported browsers based on the above requirements:
@@ -27,7 +26,7 @@ The following table is a list of supported browsers based on the above requireme
27
26
| Edge | v79+ |
28
27
| Safari | v14.5+ |
29
28
30
-
<sup>1</sup> devices running iOS needs to be on iOS 14.5+ for camera video streaming to work in Chrome, Firefox or other Apps using webviews.
29
+
<sup>1</sup> Devices running iOS need to be on iOS 14.5+ for camera video streaming to work in Chrome, Firefox or other apps using webviews.
31
30
32
31
Apart from the browsers, the operating systems may impose some limitations of their own that could restrict the use of the SDK.
33
32
@@ -46,47 +45,38 @@ Dynamsoft provides a complimentary trial license for the SDK. When you download
46
45
47
46
## Quick Start
48
47
49
-
1. Create a new text file in the same directory as this file
50
-
2. Copy the code below into the file
51
-
3. Rename the file extension to `.html` and save it
48
+
Double-click `samples/hello-world.html` to instantly see a fully functional web application that scans a single barcode using your device's camera! You can also try `samples/read-an-image.html` to decode barcodes from an image file.
52
49
53
-
Double-click the file to open it in your browser, you'll instantly see a fully functional web application that scans a single barcode using your device's camera!
50
+
>[!NOTE]
51
+
> These samples load the SDK from a CDN so they can be opened directly as local files without a web server. An internet connection is required. To serve everything from the local `dist/` folder, see [Deploying to Your Server](#deploying-to-your-server).
54
52
55
-
```html
56
-
<!DOCTYPE html>
57
-
<html>
58
-
<head>
59
-
<title>Barcode Scanner</title>
60
-
<scriptsrc="./dist/dbr.bundle.js"></script>
61
-
</head>
62
-
<body>
63
-
<script>
64
-
// You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=samples&product=dbr&package=js to get your own trial license good for 30 days.
65
-
// Note that if you downloaded this sample from Dynamsoft while logged in, the license key below may already be your own 30-day trial license.
After unzipping, you should see two folders: `dist`, which contains all the Barcode Reader JavaScript SDK resources, and `samples`, which includes subfolders for the individual sample projects.
59
+
After unzipping, you should see the following structure:
-`samples/` — Sample projects, including standalone examples (`hello-world.html`, `read-an-image.html`), framework integrations, and scenario demos
63
+
-`LICENSE` — Dynamsoft license terms
64
+
-`LEGAL.txt` — Third-party license notices
77
65
78
66
### 2. Open the Samples in a Browser
79
67
80
68
To explore the full set of available samples, open the `samples/index.html` file in your browser.
81
69
82
-
>[!IMPORTANT]
83
-
> Some browsers block local file access for security reasons. To avoid these restrictions, run the samples through a local web server.
70
+
>[!NOTE]
71
+
> The included samples load from a CDN by default. To use the local `dist/` folder instead, a web server is required (the browser blocks local file fetches over `file:///`):
72
+
> -**Standalone & scenario samples**: Switch to the commented-out `<script>` tag that points to the local `dist/` folder. No other changes are needed — the SDK infers resource paths from the script tag location.
73
+
> -**Framework samples**: These use npm imports and explicitly set `engineResourcePaths` to a CDN URL. Update `engineResourcePaths.rootDirectory` to point to the local `dist/` folder.
84
74
85
-
Here are a couple of easy ways to start one:
75
+
Here are a couple of easy ways to start a local web server:
86
76
87
77
- Using Five Server VSCode extension
88
78
89
-
If you are using VS Code, simply install the [Five Server extension](https://marketplace.visualstudio.com/items?itemName=yandeu.five-server), open the `Samples` folder in the editor, and click "Go Live" in the bottom right corner of the editor. This will serve the sample project at http://127.0.0.1:5500/index.html.
79
+
If you are using VS Code, simply install the [Five Server extension](https://marketplace.visualstudio.com/items?itemName=yandeu.five-server), open the `samples` folder in the editor, and click "Go Live" in the bottom right corner of the editor. This will serve the sample project at http://127.0.0.1:5500/index.html.
90
80
91
81
- Using Node.js and `serve`
92
82
@@ -97,13 +87,7 @@ Here are a couple of easy ways to start one:
97
87
npx serve . -l 8000
98
88
```
99
89
100
-
Once the server is running, open your browser and navigate to:
101
-
102
-
```bash
103
-
http://localhost:8000
104
-
```
105
-
106
-
You'll see the `index.html` page, which links to all sample pages.
90
+
Once the server is running, open your browser and navigate to `http://localhost:8000`. You'll see the `index.html` page, which links to all sample pages.
107
91
108
92
>[!TIP]
109
93
> Don't want to set up a local server? You can view the latest version of our samples hosted on the Dynamsoft server here:
@@ -115,19 +99,19 @@ Here are a couple of easy ways to start one:
115
99
116
100
The package includes two main sample directories:
117
101
118
-
- **`frameworks/`** - Framework-specific examples demonstrating how to integrate the Dynamsoft Barcode Reader into common web and hybrid frameworks. Each framework folder contains one or more runnable sub-examples (such as `scan-using-foundational-api` and/or `scan-using-rtu-api`) showing practical integration patterns.
102
+
- **`frameworks/`** - Framework-specific examples showing how to integrate the Dynamsoft Barcode Reader into common web and hybrid frameworks. Each framework folder contains one or more runnable sub-examples (such as `scan-using-foundational-api` and/or `scan-using-rtu-api`). Included frameworks: Angular, Blazor, Capacitor, Electron, ES6, Native TypeScript, Next.js, Nuxt, PWA, React, RequireJS, Svelte, Vue, and WebView.
119
103
120
-
- **`scenarios/`** - Focused scenario samples that show common real-world uses of the Dynamsoft Barcode Reader.
104
+
- **`scenarios/`** - Focused scenario samples covering common real-world uses of the Dynamsoft Barcode Reader, including workflow patterns (Cart Builder, Scan and Search, Batch Inventory, etc.), barcode-type-specific scanning (QR Code, DataMatrix, 1D Retail/Industrial, etc.), and data parsing (Driver's License, VIN, GS1-AI).
121
105
122
106
---
123
107
124
108
## Choosing an API
125
109
126
110
The SDK provides two approaches for integrating barcode scanning capabilities:
127
111
128
-
### RTU API (BarcodeScanner)
112
+
### Ready-To-Use (RTU) API — BarcodeScanner
129
113
130
-
The RTU API offers the quickest path to a working barcode scanner(**Recommended for most users**):
114
+
The RTU API offers the quickest path to a working barcode scanner(**Recommended for most users**):
131
115
132
116
- **One-line integration** – Launch a full scanner with a single API call
133
117
- **Built-in UI** – Pre-designed viewfinder and scan region highlighting
@@ -139,25 +123,41 @@ If you are looking for a fully customizable barcode decoding library with comple
139
123
140
124
---
141
125
142
-
## Self-Hosting Resources
126
+
## Deploying to Your Server
143
127
144
-
If you prefer to host the SDK resources on your own server instead of using a CDN:
128
+
When you're ready to deploy your application to production, copy the `dist` folder to your server and reference it in your project:
145
129
146
130
1. Copy the `dist` folder to your server
147
-
2. Include the script in your HTML:
131
+
2. Include the script and configure the SDK to load all resources locally:
148
132
149
133
```html
150
-
<!-- Adjust the path based on where you host the dist folder -->
> When loading the SDK via a `<script>` tag, `engineResourcePaths` is optional — the SDK infers resource paths from the script tag location. It is required when using npm imports (e.g., in framework projects).
161
161
162
162
---
163
163
@@ -178,4 +178,4 @@ For more information about the resource files in the `dist/` directory, please r
178
178
179
179
If you run into any issues, please feel free to contact us at support@dynamsoft.com.
180
180
181
-
Copyright Dynamsoft Corporation. All rights reserved.
0 commit comments