Skip to main content
Speed up SparkScan integration with Agent Skills

Install the Scandit plugin and use the /sparkscan-web skill so that your AI coding agent can integrate, debug, and customize SparkScan on Web following Scandit's recommended patterns. More info →

Run the following command in your project directory. It detects the supported coding agents you have installed and adds the Scandit plugin to each. Re-run it to update.

npx plugins add scandit/skills

Prefer to set it up yourself? Manual installation steps for each agent →

SparkScan settings reference

This page lists the SparkScan settings and view properties on the web, with their defaults and allowed values as the API reference states them. A blank default means the API reference states none. For what the workflow settings do for your users, see How SparkScan works.

Options​

SparkScanSettings​

SparkScanSettings holds the scanning settings, such as the enabled symbologies. To change them on a running scanner, pass them to SparkScan.applySettings().

NameTypeDefaultValuesWhat it does
constructor()ConstructorCreates settings with all symbologies disabled.
codeDuplicateFilternumber-2-2: depends on scanIntention. -1: not reported again until scanning stops. 0: no filtering. Greater than 0: time before the same code is reported again.Filters out codes with the same symbology and data that are scanned again within the interval. If you keep the default and turn the selection mode On, SparkScan doesn't filter duplicates, so users can select the same barcode again.
enabledSymbologiesSymbology[]Empty: all symbologies are disabledRead-only. The enabled symbologies.
enableSymbology()MethodEnables or disables one symbology.
enableSymbologies()MethodEnables a list of symbologies.
settingsForSymbology()MethodReturns the SymbologySettings of one symbology, for example to change its active symbol counts.
enabledCompositeTypesCompositeType[]The composite code types to scan. Added in 8.3.0.
enableSymbologiesForCompositeTypes()MethodEnables the symbologies that the given composite types need. Added in 8.3.0.
scanIntentionScanIntention | null | undefinedScanIntention.ManualScanIntention.Manual, ScanIntention.SmartWhether SparkScan identifies the barcode the user intends to scan. It has no effect while selectionMode is SelectionMode.On.
selectionModeSelectionMode | undefinedSelectionMode.OffSelectionMode.Auto, SelectionMode.On, SelectionMode.OffWhether users confirm the aimed barcode with the trigger button. With SelectionMode.Auto and no scanIntention of your own, SparkScan uses ScanIntention.Smart. Added in 8.5.0.
setProperty()MethodSets a property that isn't part of the stable API yet.
getProperty()MethodReturns the value of a property set with setProperty().

SparkScanViewSettings​

SparkScanViewSettings sets the view's default look and behavior. Pass them when you create the SparkScanView.

NameTypeDefaultValuesWhat it does
triggerButtonCollapseTimeoutnumber5000 (5 seconds)In milliseconds. A negative value switches the view to the idle state right away. To delay the switch, use a large value. The largest, 2147483647, is about 24.8 days.Time after which the view switches to the idle state.
inactiveStateTimeoutnumber10000 (10 seconds)In milliseconds.Time after which the scanner stops capturing.
scanningBehaviorSparkScanScanningBehaviorSparkScanScanningBehavior.SingleSparkScanScanningBehavior.Single, SparkScanScanningBehavior.ContinuousWhether the view scans one barcode per trigger or keeps scanning. Added in 8.5.0.
previewBehaviorSparkScanPreviewBehaviorSparkScanPreviewBehavior.DefaultSparkScanPreviewBehavior.Default, SparkScanPreviewBehavior.PersistentWhether the preview hides after a scan or stays visible. Added in 8.5.0.
defaultTorchStateTorchStateTorchState.OffTorchState.On, TorchState.OffThe torch state when the camera starts.
soundEnabledbooleantrueWhether the scan feedback plays a sound.
hapticEnabledbooleantrueWhether the scan feedback vibrates.
holdToScanEnabledbooleantrueWhether users can scan continuously by touching & holding the trigger button. Ignored while selectionMode is SelectionMode.On.
visualFeedbackEnabledbooleantrueWhether the screen flashes after a scan.
toastSettingsSparkScanToastSettingsThe text and colors of the toast messages.
selectionModeCandidateBrushBrush | nullnull uses the default brush.The brush for candidate barcodes while selectionMode is SelectionMode.Auto. Added in 8.5.0.
zoomFactorOutnumber1The camera zoom factor.
zoomFactorInnumber2The zoom factor after users tap the zoom switch control.
defaultMiniPreviewSizeSparkScanMiniPreviewSizeSparkScanMiniPreviewSize.RegularSparkScanMiniPreviewSize.Regular, SparkScanMiniPreviewSize.ExpandedThe size of the mini preview.
defaultCameraPositionCameraPositionCameraPosition.WorldFacingCameraPosition.WorldFacing, CameraPosition.UserFacingThe camera the view starts with. Beta.

SparkScanView properties​

SparkScanView properties change the view after you create it.

NameTypeDefaultValuesWhat it does
dataCaptureContextDataCaptureContext | nullThe data capture context of the view. The view shows nothing until it's set.
sparkScanSparkScan | nullThe SparkScan mode of the view. The view shows nothing until it's set.
sparkScanViewSettingsSparkScanViewSettings | nullThe view settings that set the view's default look and behavior.
feedbackDelegateSparkScanFeedbackDelegateDecides the feedback for each scanned barcode. Without a delegate, SparkScan gives success feedback.
setListener()MethodSets the SparkScanViewUiListener that receives toolbar button taps and view state changes.
triggerButtonVisiblebooleantrueShows the trigger button.
zoomSwitchControlVisiblebooleantrueShows the zoom switch control.
previewSizeControlVisiblebooleantrueShows the mini preview size control.
torchControlVisiblebooleantrueShows the torch control.
previewCloseControlVisiblebooleantrueShows the mini preview close control.
selectionModeButtonVisiblebooleanfalseShows the toolbar button that switches selectionMode between SelectionMode.On and SelectionMode.Off. Added in 8.5.0.
scanningBehaviorButtonVisiblebooleanfalseShows the toolbar button for the scanning behavior.
barcodeFindButtonVisiblebooleanfalseShows the toolbar button for MatrixScan Find.
labelCaptureButtonVisiblebooleanfalseShows the toolbar button for Smart Label Capture.
cameraSwitchButtonVisiblebooleanfalseShows the camera switch button.
triggerButtonCollapsedColorColor | undefinedThe trigger button's background color when collapsed.
triggerButtonExpandedColorColor | undefinedThe trigger button's background color when expanded.
triggerButtonAnimationColorColor | undefinedThe color of the pulsing animation around the trigger button while scanning.
triggerButtonTintColorColor | undefinedThe trigger button's tint color.
setTriggerButtonImage()MethodSets the image on the trigger button.
toolbarBackgroundColorColor | undefinedundefinedThe toolbar's background color.
toolbarIconActiveTintColorColor | undefinedundefinedThe color of active toolbar icons.
toolbarIconInactiveTintColorColor | undefinedundefinedThe color of inactive toolbar icons.

Framework differences​

On the web, these options differ from the other SparkScan frameworks:

  • scanIntention defaults to ScanIntention.Manual. On the other frameworks, it defaults to smart.
  • selectionMode defaults to SelectionMode.Off. On the other frameworks, it defaults to auto.
  • A negative triggerButtonCollapseTimeout switches the view to the idle state right away. On the other frameworks, a negative value means no timeout.
  • There's no hardware trigger: the web SDK has no hardwareTriggerEnabled setting.
  • There's no battery saving setting: the web SDK has no batterySaving property.
  • The toolbar has no MatrixScan Count button: the web SDK has no barcodeCountButtonVisible property.
  • In the API reference, ScanIntention and SelectionMode are under core, but you import them from @scandit/web-datacapture-barcode.

Next step​

Choosing which barcode types to scan