From 3a43a0f6c4154a72cf8779f33ba60a6a5a10fa9b Mon Sep 17 00:00:00 2001 From: Anthony Penna Date: Fri, 24 Jul 2026 12:41:41 +0200 Subject: [PATCH 1/2] [SDC-32633] Document Web SDK UMD builds in add-sdk.md --- docs/sdks/web/add-sdk.md | 114 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) diff --git a/docs/sdks/web/add-sdk.md b/docs/sdks/web/add-sdk.md index 493e354c..50c2b32e 100644 --- a/docs/sdks/web/add-sdk.md +++ b/docs/sdks/web/add-sdk.md @@ -267,6 +267,120 @@ In alternative to jsdeliver, unpkg can be used: ``` +## Install via UMD build (plain ` + + + + +
+ + + +``` + +:::tip +The same production considerations described under [Install via CDN](#install-via-cdn) apply here: for production, self-host the UMD bundles and the `sdc-lib` files rather than depending on a public CDN. +::: + ## Configure the Library The library needs to be configured and initialized before it can be used, this is done via the DataCaptureContext [`forLicenseKey`](https://docs.scandit.com/data-capture-sdk/web/core/api/data-capture-context.html#class-scandit.datacapture.core.DataCaptureContext) function. From 20ee2bef5a216f666f786e1669ebfe18b8991de1 Mon Sep 17 00:00:00 2001 From: Anthony Penna Date: Mon, 3 Aug 2026 14:19:47 +0200 Subject: [PATCH 2/2] [SDC-32633] Address review: trim UMD section, frame it as last resort MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace the full HTML page with just the delta over the CDN example (script tags, globals, async wrapper), per review feedback that a complete example gives UMD too much space on this page. - Add a caution that UMD bundles can't be tree-shaken/optimized like the ESM build, so startup is slower, and that es-module-shims is the preferred fallback when import maps are the only blocker. UMD is a last resort. - Use DataCaptureContext.sharedInstance in the snippet. - Fix the CDN paths: the umd subpath resolves to build/js/umd/index.js, and only exports-aware resolvers understand the bare `/umd` subpath — raw CDN URLs need the full path. Co-Authored-By: Claude Opus 5 (1M context) --- docs/sdks/web/add-sdk.md | 117 ++++++++++----------------------------- 1 file changed, 28 insertions(+), 89 deletions(-) diff --git a/docs/sdks/web/add-sdk.md b/docs/sdks/web/add-sdk.md index 50c2b32e..16023e5f 100644 --- a/docs/sdks/web/add-sdk.md +++ b/docs/sdks/web/add-sdk.md @@ -269,7 +269,13 @@ In alternative to jsdeliver, unpkg can be used: ## Install via UMD build (plain ` - - - - -
- + +``` - // Depending on the use case further camera settings adjustments can be made here. - const cameraSettings = BarcodeCapture.recommendedCameraSettings; - await camera.applySettings(cameraSettings); +From there the setup is the same as in the [CDN example](#install-via-cdn) above, with two differences: you take the exports off the globals instead of importing them, and you wrap the setup in an async function, because a classic ` - - + // Continue with the camera, mode and listener setup as in the CDN example. +})(); ``` :::tip