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 be awaited — it is async and sets DataCaptureContext.sharedInstance. Do not capture its return value; use DataCaptureContext.sharedInstance throughout.
  • BarcodeCapture.forContext(context, settings) is async — always await it.
  • DataCaptureView.forContext(context) is async — always await it.
  • BarcodeCaptureOverlay.withBarcodeCaptureForView(barcodeCapture, view) is async — always await it.
  • barcodeCapture.setEnabled(false/true) is async — await it before doing work in didScan to prevent duplicate scans.
  • The listener callback is didScannot onBarcodeScanned (that is the Android name).
  • codeDuplicateFilter is a number in milliseconds on web (e.g. 500) — not a TimeInterval object like Android.
  • BarcodeCapture.recommendedCameraSettings is 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 and FrameSourceState.Off to stop. The camera does not stop automatically.
Related skills

More from scandit/scandit-sdk-skills

Installs
4
GitHub Stars
10
First Seen
1 day ago