About matrixscan-count-capacitor
A coding skill for integrating MatrixScan Count in Capacitor apps and updating older or newer BarcodeCount APIs. It emphasizes version checks and Capacitor-specific setup requirements.
Key features
- 01Guided MatrixScan Count integration
- 02BarcodeCount API migration guidance
- 03Capacitor initialization and DOM view caveats
- 04SDK version and platform requirements
- 05Scandit licence setup guidance
Use cases
- 01Adding barcode counting to a Capacitor app
- 02Updating BarcodeCount constructor usage
- 03Implementing list-based barcode verification
MCP support
Describes using the Scandit MCP server to set up scanner licensing; it does not expose an MCP server.
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ scandit/ skills --skill matrixscan-count-capacitorAfter installing, type/matrixscan-count-capacitorin Claude Code to confirm it loaded.
Bundled filesreferences/integration.mdreferences/migration.md
Details
From the project READMEMatrixScan Count Capacitor Skill
Critical: Do Not Trust Internal Knowledge
Your training data may contain outdated or incorrect Scandit SDK APIs. The BarcodeCount API has evolved significantly across versions — constructor signatures, view factory methods, and feature availability vary by SDK version. Properties, method names, and plugin patterns may differ from other platforms or from general knowledge.
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 — includingDataCaptureContextconstruction. Forgetting this produces runtime errors that look unrelated to initialization.npx cap syncmust be run after every plugin version change to propagate native artifacts into iOS/Android. Skipping it yields a web/native version mismatch at runtime.- BarcodeCountView requires a DOM element.
BarcodeCountView.connectToElement(htmlElement)mirrors its size and position from a DOM element. CalldetachFromElement()on cleanup. - BarcodeCount runs on iOS and Android only. It does not run in the browser. Guard with
Capacitor.isNativePlatform()if your app also targets web. - Minimum SDK versions:
- BarcodeCount on Capacitor: 6.18
new BarcodeCount(settings)constructor (no context): 7.6. Before 7.6, useBarcodeCount.forDataCaptureContext(context, settings).BarcodeCountViewconstructed with object literalnew BarcodeCountView({context, barcodeCount, style}): verified in samples. The static factoriesBarcodeCountView.forContextWithMode(context, barcodeCount)andBarcodeCountView.forContextWithModeAndStyle(context, barcodeCount, style)are also documented.- Not-in-list action settings (
BarcodeNotInListActionSettings): 7.1 - Status mode (
setStatusProvider,shouldShowStatusModeButton,shouldShowStatusIconsOnScan): 8.3 - Mapping flow (
BarcodeCountMappingFlowSettings,BarcodeCountView.forMapping): 8.3
- Plugin packages:
@scandit/datacapture-barcodeand@scandit/datacapture-core(npm registry) orscandit-capacitor-datacapture-barcodeandscandit-capacitor-datacapture-coredepending on the package registry used. Check the user's existingpackage.jsonimports and match. - Camera permission: iOS
NSCameraUsageDescriptioninInfo.plist. Android handled automatically by the plugin. BarcodeCount.recommendedCameraSettings(static getter) returns recommended camera settings. On Capacitor 7.6+,BarcodeCount.createRecommendedCameraSettings()(static method) is also available — the sample uses the getter form.barcodeCount.isEnabled = truemust be set to start scanning after creatingBarcodeCountView.
Intent Routing
Based on the user's request, load the appropriate reference file before responding:
-
Integrating MatrixScan Count from scratch (e.g. "add MatrixScan Count to my app", "set up BarcodeCount", "how do I use BarcodeCountView in Capacitor", "how do I count barcodes", "scan against a list", "packing slip verification", "receiving workflow") → read references/integration.md and follow the instructions there.
-
Migrating from an older BarcodeCount API or adding newer features (e.g. "upgrade BarcodeCount constructor", "migrate from forDataCaptureContext", "add status mode", "add mapping flow", "add not-in-list actions") → read references/migration.md and follow the migration steps there.
API Usage Policy
Only use APIs that are explicitly documented in the Scandit references below. Do not invent or guess method signatures, parameters, property names, or imports. If unsure whether an API exists or how it is called — or if a TypeScript / runtime error occurs — fetch the relevant reference page before responding. Do not tell the user to check the docs themselves. After answering, always include the relevant link so the user can explore further.
Never construct or guess documentation URLs. When you need a specific class or property's API page:
- First check whether the page you already fetched (e.g. the Get Started page) contains a direct hyperlink to it — topic pages link directly to relevant API symbols.
- If no direct link was found, fetch the API index (see Full API reference in the table below), extract the actual link from it, and follow that.
Framework variant policy
Capacitor is a WebView-based framework. Examples in this skill use plain JavaScript (ES modules). TypeScript projects can use the same imports and APIs verbatim — just add types — but this skill does not assume a TypeScript project by default. If the target project is clearly TypeScript (.ts files, tsconfig.json), adapt the final output to TypeScript syntax; otherwise stay in plain JS.
Licence key
Scanning needs a Scandit licence key. For this skill the licence product is native and the licence platforms are ios and android.
Work through these in order — never block the user on MCP:
-
The Scandit MCP server is connected — call
ensure_scanner_setupwith productnativeand platformsiosandandroid, then run the commandget_license_env_commandreturns, which writes the key into the project's.env. Show at most a masked preview in chat; never print a full key. -
It is not connected — offer to connect it once, then continue from step 1:
- Claude Code:
claude mcp add --transport http scandit https://ssl.scandit.com/mcp - Cursor: add
{"mcpServers": {"scandit": {"url": "https://ssl.scandit.com/mcp"}}}to~/.cursor/mcp.json - VS Code: add
{"servers": {"scandit": {"type": "http", "url": "https://ssl.scandit.com/mcp"}}}to the MCP user configuration
Authentication is browser-based, so it is not supported headless or in CI. The server provisions trial keys only; it never creates, revokes, or modifies production licences.
- Claude Code:
-
The user declines, or has no MCP client — they generate a key themselves at https://ssl.scandit.com (no account yet: https://ssl.scandit.com/dashboard/sign-up?p=test) and paste it in.
Then put the key into the code in place of the placeholder; a key in .env does not reach the app by itself. Read it through the web bundler's env support, for example import.meta.env in Vite (which only exposes VITE_-prefixed names unless envPrefix says otherwise). The simplest route on any platform: read .env and put the key into the licence-key call directly, still showing only a masked preview in chat.
References
Direct users to the right resource based on their question:
| Topic | Resource |
|---|---|
| Capacitor integration | Get Started · Sample |
| Full API reference | BarcodeCount API |