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
As you have gone through the [user guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=latest#getting-started---hello-world), you might have seen some basic "Hello World" code to help you quickly create a basic web application that uses our SDK.
4
+
5
+
This sample set will revisit the Hello World code, and its implementation in some of the popular frameworks such as Angular, React, an Vue.
6
+
7
+
Let's break down each of the samples
8
+
9
+
## Hello World - Read Barcodes via Video
10
+
11
+
In this sample, you will find the basic lines of code ncessary to initialize the SDK and set it up.
12
+
13
+
Let's quickly break down the methods used in order:
14
+
15
+
*`license`: This property specifies a license key. Read more on Specify the license.
16
+
*`createInstance()`: This method creates a `BarcodeScanner` object. This object can read barcodes directly from a video input with the help of its interactive UI (hidden by default) and the MediaDevices interface.
17
+
*`onFrameRead`: This event is triggered every time the SDK finishes scanning a video frame. The results object contains all the barcode results that the SDK have found on this frame. In this example, we print the results to the browser console.
18
+
*`onUniqueRead`: This event is triggered when the SDK finds a new barcode, which is not a duplicate among multiple frames. txt holds the barcode text value while result is an object that holds details of the barcode. In this example, an alert will be displayed for this new barcode.
19
+
*`show()`: This method brings up the built-in UI of the `BarcodeScanner` object and starts scanning
20
+
21
+
In fact, `onFrameRead` and `onUniqueRead` do not have to both be defined in the code. `onUniqueRead` is the more used one between the two as it is triggered when a new barcode is found rather than on every frame.
22
+
23
+
## Hello World - Read Barcodes from an Image
24
+
25
+
The second sample in this set focuses on the secondary class `BarcodeReader` which is a low-level barcode reader that processes still images and returns barcode results.
26
+
27
+
In this sample, a listener is set up so that the SDK decodes any image that the user uploads.
28
+
29
+
[`decode`](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/BarcodeReader.html?ver=latest#decode) is the main method to go for when using the `BarcodeReader` class, although the class offers a number of other methods should you work with base64 strings, for instance. The rest of the image decoding methods can be found [here](https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/BarcodeReader.html?ver=latest#decode-barcodes).
30
+
31
+
## Hello World - Angular
32
+
33
+
Read more on the sample [here](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-angular.html).
34
+
35
+
## Hello World in React
36
+
37
+
Read more on the sample [here](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-reactjs.html).
38
+
39
+
## Hello World in Vue 2
40
+
41
+
Read more on the sample [here](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-vuejs.html).
42
+
43
+
## Hello World in Vue 3
44
+
45
+
Read more on the sample [here](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-vuejsv3.html).
46
+
47
+
## Hello World in Next.js
48
+
49
+
Read more on the sample [here](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-nextjs.html).
50
+
51
+
## Hello World in NuxtJS
52
+
53
+
Read more on the sample [here](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-nuxtjs.html).
54
+
55
+
## Hello World in Electron
56
+
57
+
Read more on the sample [here](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-electron.html).
58
+
59
+
## Hello World in PWA
60
+
61
+
Read more on the sample [here](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-pwa.html).
62
+
63
+
## Hello World with RequireJS
64
+
65
+
Read more on the sample [here](https://www.dynamsoft.com/barcode-reader/programming/javascript/samples-demos/helloworld-requirejs.html).
66
+
67
+
## Hello World with ES6
68
+
69
+
This sample shows how to use the SDK in a web page based on ES6 (also known as ECMAScript 2015 or ECMAScript 6).
70
+
71
+
## Support
72
+
73
+
If you have any questions, feel free to contact Dynamsoft support via [email](mailto:support@dynamsoft.com) or [live chat](https://www.dynamsoft.com/barcode-reader/overview/) via the "Let's Chat" button.
0 commit comments