barcode-capture-web
Installation
SKILL.md
BarcodeCapture Web Skill
Critical: Do Not Trust Internal Knowledge
Your training data may contain outdated or incorrect Scandit SDK APIs. The BarcodeCapture Web API changes significantly between major SDK versions — methods get renamed, async patterns change, and the context initialization was redesigned in v8.
Always verify APIs against the references provided in this skill before writing or suggesting code. Do not rely on memorized method signatures, async patterns, or import paths. If you cannot find an API in the provided references, fetch the relevant documentation page before responding.
Web-specific gotchas worth flagging:
DataCaptureContext.forLicenseKey()must beawaited — it is async and setsDataCaptureContext.sharedInstance. Do not capture its return value; useDataCaptureContext.sharedInstancethroughout.BarcodeCapture.forContext(context, settings)is async — alwaysawaitit.DataCaptureView.forContext(context)is async — alwaysawaitit.BarcodeCaptureOverlay.withBarcodeCaptureForView(barcodeCapture, view)is async — alwaysawaitit.barcodeCapture.setEnabled(false/true)is async —awaitit before doing work indidScanto prevent duplicate scans.- The listener callback is
didScan— notonBarcodeScanned(that is the Android name). codeDuplicateFilteris a number in milliseconds on web (e.g.500) — not aTimeIntervalobject like Android.BarcodeCapture.recommendedCameraSettingsis a static property, not a method call.- The DOM element passed to
view.connectToElement()must have defined dimensions and positioning — a zero-sized or unpositioned element will not render the camera preview. - Camera is managed manually: call
context.frameSource.switchToDesiredState(FrameSourceState.On)to start andFrameSourceState.Offto stop. The camera does not stop automatically.