id-capture-web
Installation
SKILL.md
ID Capture Web (TypeScript/JavaScript) Skill
Critical: Do Not Trust Internal Knowledge
Your training data may contain outdated or incorrect Scandit ID Capture APIs. The Web SDK API has changed significantly across major versions, and the Web SDK differs substantially from the native iOS (Swift), Android (Kotlin/Java), .NET, Flutter, and React Native SDKs. An agent that pattern-matches from another platform's docs will produce non-working code. Two Web-specific facts dominate:
- The Web SDK is async-first. Almost every state-changing call returns a
Promiseand must beawaited — creating the context, creating the mode, enabling/disabling, applying settings, adding the overlay. There are no synchronous constructors for the mode or overlay. - You must register the ID module loader.
idCaptureLoader({ enableVIZDocuments: true })has to be passed inmoduleLoaderswhen creating theDataCaptureContext, or ID Capture will not work.enableVIZDocuments: trueis required to read the Visual Inspection Zone (the printed text on the document); without it only barcode/MRZ scanning is available.
Always verify APIs against the references and source in this package before writing or suggesting code. The most common sources of wrong code:
- The v6 API —
supportedDocuments(a bitmask),supportedSides, and session-based callbacks were replaced. Do not emit any of these. - The v7.0-era API —
settings.scannerType = new FullDocumentScanner()was replaced; the current property isscannerand it takes anIdCaptureScannerwrapper constructed with an options object:settings.scanner = new IdCaptureScanner({ physicalDocument: new FullDocumentScanner() }). - Cross-platform drift — iOS uses
IdCapture(context:settings:), Android usesIdCapture.forDataCaptureContext(...), .NET usesIdCapture.Create(...). The Web API isawait IdCapture.forContext(context, settings). isEnabled— on Web this is the methodidCapture.isEnabled()to read andawait idCapture.setEnabled(true)to set. It is NOT an assignable property.- AAMVA forged-barcode verification — unlike iOS/Android, the Web SDK has no
rejectForgedAamvaBarcodessetting. AAMVA barcode verification on Web is done through the standalone classAamvaBarcodeVerifier(await AamvaBarcodeVerifier.create(context), thenawait verifier.verify(capturedId)). Data-consistency verification is settings-driven (rejectInconsistentData = true). - Images are base64 data-URL strings, not native bitmaps.
capturedId.images.face/.getFrame(IdSide.Front)/.getCroppedDocument(IdSide.Back)returnstring | null(adata:image/...URL), suitable for an<img>src. They are only populated when enabled viasettings.setShouldPassImageTypeToResult(IdImageType.Face, true).