barcode-capture-capacitor

Installation
SKILL.md

BarcodeCapture Capacitor Skill

Critical: Do Not Trust Internal Knowledge

Your training data may contain outdated or incorrect Scandit SDK APIs. The BarcodeCapture API changes between major SDK versions — properties get renamed, removed, or restructured, and the Capacitor plugin surface (imports, plugin initialization, native sync steps) has also evolved.

Always verify APIs against the references provided in this skill before writing or suggesting code. Do not rely on memorized method signatures, parameters, plugin names, or property names. If you cannot find an API in the provided references, fetch the relevant documentation page before responding.

Capacitor-specific gotchas worth flagging:

  • ScanditCaptureCorePlugin.initializePlugins() must be called (and awaited) before any other Scandit API — including DataCaptureContext construction. Forgetting this produces runtime errors that look unrelated to initialization.
  • npx cap sync must be run after every plugin version change to propagate native artifacts into iOS/Android. Skipping it yields a web/native version mismatch at runtime.
  • BarcodeCapture renders into a DataCaptureView that is connected to a DOM element via view.connectToElement(...). The view itself is a native overlay, but the DOM container determines its size and position. A BarcodeCaptureOverlay must be created and added to the view to visualize recognized barcodes.
  • The camera is a separate component: Camera.default (or Camera.withSettings(BarcodeCapture.createRecommendedCameraSettings())), set via context.setFrameSource(camera), then started via camera.switchToDesiredState(FrameSourceState.On).
  • Disable the mode while handling a scan: the didScan callback blocks further frame processing on Capacitor. If you do any meaningful work (database lookup, navigation, network) inside didScan, set barcodeCapture.isEnabled = false first, perform the work, then re-enable. This is documented behavior on Capacitor specifically.
  • BarcodeCapture only renders on native platforms (iOS, Android). If your app also targets the web build of Capacitor, guard initialization with Capacitor.isNativePlatform().

Intent Routing

Based on the user's request, load the appropriate reference file before responding:

Related skills

More from scandit/scandit-sdk-skills

Installs
2
GitHub Stars
10
First Seen
14 days ago