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/skillsPrefer 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().
| Name | Type | Default | Values | What it does |
|---|---|---|---|---|
constructor() | Constructor | Creates settings with all symbologies disabled. | ||
codeDuplicateFilter | number | -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. |
enabledSymbologies | Symbology[] | Empty: all symbologies are disabled | Read-only. The enabled symbologies. | |
enableSymbology() | Method | Enables or disables one symbology. | ||
enableSymbologies() | Method | Enables a list of symbologies. | ||
settingsForSymbology() | Method | Returns the SymbologySettings of one symbology, for example to change its active symbol counts. | ||
enabledCompositeTypes | CompositeType[] | The composite code types to scan. Added in 8.3.0. | ||
enableSymbologiesForCompositeTypes() | Method | Enables the symbologies that the given composite types need. Added in 8.3.0. | ||
scanIntention | ScanIntention | null | undefined | ScanIntention.Manual | ScanIntention.Manual, ScanIntention.Smart | Whether SparkScan identifies the barcode the user intends to scan. It has no effect while selectionMode is SelectionMode.On. |
selectionMode | SelectionMode | undefined | SelectionMode.Off | SelectionMode.Auto, SelectionMode.On, SelectionMode.Off | Whether 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() | Method | Sets a property that isn't part of the stable API yet. | ||
getProperty() | Method | Returns 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.
| Name | Type | Default | Values | What it does |
|---|---|---|---|---|
triggerButtonCollapseTimeout | number | 5000 (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. |
inactiveStateTimeout | number | 10000 (10 seconds) | In milliseconds. | Time after which the scanner stops capturing. |
scanningBehavior | SparkScanScanningBehavior | SparkScanScanningBehavior.Single | SparkScanScanningBehavior.Single, SparkScanScanningBehavior.Continuous | Whether the view scans one barcode per trigger or keeps scanning. Added in 8.5.0. |
previewBehavior | SparkScanPreviewBehavior | SparkScanPreviewBehavior.Default | SparkScanPreviewBehavior.Default, SparkScanPreviewBehavior.Persistent | Whether the preview hides after a scan or stays visible. Added in 8.5.0. |
defaultTorchState | TorchState | TorchState.Off | TorchState.On, TorchState.Off | The torch state when the camera starts. |
soundEnabled | boolean | true | Whether the scan feedback plays a sound. | |
hapticEnabled | boolean | true | Whether the scan feedback vibrates. | |
holdToScanEnabled | boolean | true | Whether users can scan continuously by touching & holding the trigger button. Ignored while selectionMode is SelectionMode.On. | |
visualFeedbackEnabled | boolean | true | Whether the screen flashes after a scan. | |
toastSettings | SparkScanToastSettings | The text and colors of the toast messages. | ||
selectionModeCandidateBrush | Brush | null | null uses the default brush. | The brush for candidate barcodes while selectionMode is SelectionMode.Auto. Added in 8.5.0. | |
zoomFactorOut | number | 1 | The camera zoom factor. | |
zoomFactorIn | number | 2 | The zoom factor after users tap the zoom switch control. | |
defaultMiniPreviewSize | SparkScanMiniPreviewSize | SparkScanMiniPreviewSize.Regular | SparkScanMiniPreviewSize.Regular, SparkScanMiniPreviewSize.Expanded | The size of the mini preview. |
defaultCameraPosition | CameraPosition | CameraPosition.WorldFacing | CameraPosition.WorldFacing, CameraPosition.UserFacing | The camera the view starts with. Beta. |
SparkScanView properties
SparkScanView properties change the view after you create it.
| Name | Type | Default | Values | What it does |
|---|---|---|---|---|
dataCaptureContext | DataCaptureContext | null | The data capture context of the view. The view shows nothing until it's set. | ||
sparkScan | SparkScan | null | The SparkScan mode of the view. The view shows nothing until it's set. | ||
sparkScanViewSettings | SparkScanViewSettings | null | The view settings that set the view's default look and behavior. | ||
feedbackDelegate | SparkScanFeedbackDelegate | Decides the feedback for each scanned barcode. Without a delegate, SparkScan gives success feedback. | ||
setListener() | Method | Sets the SparkScanViewUiListener that receives toolbar button taps and view state changes. | ||
triggerButtonVisible | boolean | true | Shows the trigger button. | |
zoomSwitchControlVisible | boolean | true | Shows the zoom switch control. | |
previewSizeControlVisible | boolean | true | Shows the mini preview size control. | |
torchControlVisible | boolean | true | Shows the torch control. | |
previewCloseControlVisible | boolean | true | Shows the mini preview close control. | |
selectionModeButtonVisible | boolean | false | Shows the toolbar button that switches selectionMode between SelectionMode.On and SelectionMode.Off. Added in 8.5.0. | |
scanningBehaviorButtonVisible | boolean | false | Shows the toolbar button for the scanning behavior. | |
barcodeFindButtonVisible | boolean | false | Shows the toolbar button for MatrixScan Find. | |
labelCaptureButtonVisible | boolean | false | Shows the toolbar button for Smart Label Capture. | |
cameraSwitchButtonVisible | boolean | false | Shows the camera switch button. | |
triggerButtonCollapsedColor | Color | undefined | The trigger button's background color when collapsed. | ||
triggerButtonExpandedColor | Color | undefined | The trigger button's background color when expanded. | ||
triggerButtonAnimationColor | Color | undefined | The color of the pulsing animation around the trigger button while scanning. | ||
triggerButtonTintColor | Color | undefined | The trigger button's tint color. | ||
setTriggerButtonImage() | Method | Sets the image on the trigger button. | ||
toolbarBackgroundColor | Color | undefined | undefined | The toolbar's background color. | |
toolbarIconActiveTintColor | Color | undefined | undefined | The color of active toolbar icons. | |
toolbarIconInactiveTintColor | Color | undefined | undefined | The color of inactive toolbar icons. |
Framework differences
On the web, these options differ from the other SparkScan frameworks:
scanIntentiondefaults toScanIntention.Manual. On the other frameworks, it defaults to smart.selectionModedefaults toSelectionMode.Off. On the other frameworks, it defaults to auto.- A negative
triggerButtonCollapseTimeoutswitches 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
hardwareTriggerEnabledsetting. - There's no battery saving setting: the web SDK has no
batterySavingproperty. - The toolbar has no MatrixScan Count button: the web SDK has no
barcodeCountButtonVisibleproperty. - In the API reference,
ScanIntentionandSelectionModeare under core, but you import them from@scandit/web-datacapture-barcode.