mcpField
S
sparkscan-web

sparkscan-web

github.com/scanditDevelopment2060 installsUpdated 5d ago
Repository

About sparkscan-web

A web-focused coding skill for integrating and troubleshooting Scandit SparkScan. It directs coding agents to version-specific references and documents API verification, setup, migration, and runtime guidance.

Key features

  1. 01Routes integration, React, migration, and troubleshooting questions
  2. 02Requires checking supplied API references
  3. 03Documents CDN version pinning and isolation setup
  4. 04Guides Scandit licence-key setup through MCP

Use cases

  1. 01Adding SparkScan to a web app
  2. 02Adapting SparkScan guidance for a React project
  3. 03Investigating camera or deployment problems

MCP support

The skill describes using the Scandit MCP server to prepare scanner setup and retrieve licence keys, with safeguards for key handling.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/scandit/skills --skill sparkscan-web

After installing, type/sparkscan-webin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
integration.md
migration.md
react.md
troubleshooting.md
references/fixtures/
ScanditProvider.tsx
spark-scan-view.d.ts

Details

From the project README

SparkScan Web Skill

Critical: Do Not Trust Internal Knowledge

Your training data may contain outdated or incorrect Scandit SDK APIs. The SparkScan API changes significantly between major SDK versions — properties get renamed, removed, or restructured.

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

Web-specific gotchas worth flagging:

  • Do not add a visibilitychange handler to pause scanning: SparkScanView already switches to its idle state when the page is hidden.
  • When the SDK is loaded from a CDN, pin one exact version (for example @8.6.1) in every URL: the import map and libraryLocation. A floating @8 lets the JavaScript and the engine resolve to different releases, which breaks start-up.
  • Cross-origin isolation needs Cross-Origin-Opener-Policy: same-origin and Cross-Origin-Embedder-Policy: require-corp, also when the SDK comes from the jsDelivr CDN. Do not recommend credentialless for the SDK. In the page code, start BrowserHelper.checkMultithreadingSupport() (from @scandit/web-datacapture-core) without awaiting it, before await DataCaptureContext.forLicenseKey(), so the two run in parallel and set-up never waits for the check. When it resolves false, show the multithreading dialog unless the user asked to run single-threaded: import showMultithreadingWarning from the multithreading-warning helper module in references/integration.md, which needs no page markup. In React, render the same dialog from component state instead of importing the helper. The dialog shows at most once per page load and honors the "don't show again this session" checkbox. COEP credentialless is not a request to run single-threaded: Safari does not support it, so the dialog still shows there.

Intent Routing

Based on the user's request, load the appropriate reference file before responding. More than one may apply (e.g. a React integration that also hits a camera issue) — read all that are relevant:

  • Integrating SparkScan from scratch (e.g. "add SparkScan to my app", "set up barcode scanning", "how do I use SparkScan", "how do I handle feedback in SparkScan", "I want to build a scanning app") → read references/integration.md and follow the instructions there. If the user has no existing project, the guide will direct you to offer the pre-built sample first.
  • The project uses React (a react dependency in package.json, .tsx/.jsx files, hooks, JSX) → also read references/react.md. The correct way to bind the <spark-scan-view> custom element differs by React major version, so check the react version in package.json first — the guide explains the React 18 vs 19 difference and the context/lifecycle pitfalls. Always consult it before writing React code; the generic integration.md example is vanilla TS.
  • Migrating or upgrading an existing SparkScan integration (e.g. "upgrade from v6 to v7", "migrate my SparkScan", "what changed between SDK versions") → read references/migration.md and follow the instructions there.
  • Runtime, camera, or deployment trouble (e.g. "camera won't open on my phone", "works for a second then dies", cross-origin/COOP/COEP/header issues, "blank preview over a LAN IP") → read references/troubleshooting.md. These are environment/hosting issues, not API mistakes, and are easy to misdiagnose as code bugs.

API Usage Policy

Only use APIs that are explicitly documented in the Scandit references below. Do not invent or guess method signatures, parameters, or view modifiers. If unsure whether an API exists or how it is called — or if a compile 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:

  1. First check whether the page you already fetched (e.g. the Advanced Configurations page) contains a direct hyperlink to it — topic pages link directly to relevant API symbols. Always request links alongside content in your fetch prompt.
  2. 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.

URL structures can vary (e.g. api/ui/ subdirectory) and guessing will lead to 404s.

Licence key

Scanning needs a Scandit licence key. For this skill the licence product is sdk and the licence platform is webassembly.

Work through these in order — never block the user on MCP:

  1. The Scandit MCP server is connected — call ensure_scanner_setup with product sdk and platforms webassembly, app_identifier (the app's bundle or application id; for web, its production domain, never localhost) and env_var SCANDIT_LICENSE_KEY. Do not run the command it returns. Then call get_license_key with the key's id, from that result or from list_license_keys; if list_license_keys shows the key is not a trial, ask the user before fetching it. Show at most a masked preview in chat; never print a full key.

  2. It is not connected — tell the user once that they can connect the remote Scandit MCP server, https://ssl.scandit.com/mcp, in their MCP client, then continue from step 1. Do not edit MCP client configuration yourself.

    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.

  3. 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: write it into the licence-key call in place of the placeholder — the key get_license_key returned, or the one the user pastes or gives you — still showing only a masked preview in chat. Do not search the project, its files or the environment for a key.

References

Direct users to the right resource based on their question:

TopicResource
Basic integrationGet Started · Sample
React integrationGet Started · Sample
Advanced topics (custom feedback, hardware triggers, scanning modes, UI customization)Advanced Configurations
Full API referenceSparkScan API

Comments

Markdown supported