Skip to content

Commit 2ad8e47

Browse files
committed
react: ScanbotSDK v7.2.0-rc.7
1 parent 70e09ce commit 2ad8e47

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

react-js/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

react-js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"react": "19.0.0",
2020
"react-dom": "19.0.0",
2121
"react-router-dom": "6.28.0",
22-
"scanbot-web-sdk": "7.1.0"
22+
"scanbot-web-sdk": "7.2.0-rc.7"
2323
},
2424
"devDependencies": {
2525
"@eslint/js": "^9.15.0",

react-js/src/App.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,16 @@ function App() {
6161
const config = new ScanbotSDK.UI.Config.DocumentScanningFlow();
6262
config.screens.camera.backgroundColor = '#FF0000';
6363
const result = await ScanbotSDK.UI.createDocumentScanner(config);
64-
console.log('Scan result', result);
64+
setToast(`Scan result: ${JSON.stringify(result)}`);
6565
}} />
6666
<FeatureListItem icon={QrCode} text='Barcode Scanner UI' onClick={async () => {
6767
// Configure your barcode scanner as needed
6868
const config = new ScanbotSDK.UI.Config.BarcodeScannerScreenConfiguration();
69+
6970
config.useCase = new ScanbotSDK.UI.Config.SingleScanningMode();
7071
const result = await ScanbotSDK.UI.createBarcodeScanner(config);
71-
console.log('Barcode result', result);
72+
73+
setToast(`Barcode result: ${JSON.stringify(result)}`);
7274
}} />
7375

7476
<SectionHeader title={"Data Extraction"} />

react-js/src/service/SBSDKService.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,14 @@ export default class SBSDKService {
3737
// The binaries are located under node_modules/scanbot-web-sdk/bundle/.
3838
// In this example, we're automatically copying the complete bundle directory to the public wasm/ folder.
3939
// have a look at package.json's script "postinstall" for more details
40-
enginePath: './wasm/'
40+
enginePath: './wasm/',
41+
onComplete: (error) => {
42+
if (error) {
43+
console.error("SDK initialization failed: ", error);
44+
} else {
45+
console.log("SDK initialized successfully");
46+
}
47+
}
4148
});
4249
}
4350
}

0 commit comments

Comments
 (0)