Skip to content

Commit 2f0c206

Browse files
committed
Expand Foundational API code sample and revise BarcodeScanner roadmap notice
1 parent f8bb84f commit 2f0c206

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

programming/javascript/index.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,24 @@ DBR-JS provides two integration paths to suit different application needs:
4646
The **Foundational API** — centered on `CaptureVisionRouter` — is the primary and recommended way to use DBR-JS. It gives you full control over the entire capture pipeline: decoding, camera management, result filtering, UI, and seamless integration with other Dynamsoft products.
4747

4848
```js
49+
// Create a camera view and connect it to the page
50+
let cameraView = await Dynamsoft.DCE.CameraView.createInstance();
51+
document.querySelector("#camera-view-container").append(cameraView.getUIElement());
52+
let cameraEnhancer = await Dynamsoft.DCE.CameraEnhancer.createInstance(cameraView);
53+
54+
// Set up the barcode reading pipeline
4955
const router = await Dynamsoft.CVR.CaptureVisionRouter.createInstance();
56+
router.setInput(cameraEnhancer);
5057
router.addResultReceiver({
5158
onDecodedBarcodesReceived: (result) => {
5259
for (const item of result.barcodeResultItems) {
5360
console.log(item.text);
5461
}
5562
}
5663
});
64+
65+
// Start scanning
66+
await cameraEnhancer.open();
5767
await router.startCapturing("ReadSingleBarcode");
5868
```
5969

@@ -72,7 +82,7 @@ new Dynamsoft.BarcodeScanner().launch().then(result => alert(result.barcodeResul
7282
</p>
7383

7484
> [!IMPORTANT]
75-
> **Roadmap notice:** `BarcodeScanner` is officially maintained and fully supported throughout **v11** with no planned breaking changes. Starting from **v12**, it will no longer be bundled as part of the DBR-JS product — it will be distributed as a separate package. If you are starting a new project, we recommend building on the Foundational API to ensure forward compatibility.
85+
> **Roadmap notice:** `BarcodeScanner` is officially maintained and fully supported throughout **v11** with no planned breaking changes. Starting from **v12**, it will no longer be bundled as part of the DBR-JS product but will continue to be maintained as an official wrapper, which is distributed as a separate package. If you are starting a new project, we recommend building on the Foundational API to ensure best customiztion and forward compatibility.
7686
7787
## Next Step
7888

0 commit comments

Comments
 (0)