VC Verification Module
A common library for VC verification, usable across Sunbird RC frontends. Scans QR codes inside Angular apps.
Install the scanner
The deprecated ngx-scanner integration was removed starting from vc-verification@0.0.13. Install @zxing/ngx-scanner separately, matching your Angular version:
npm i @zxing/ngx-scanner@vx.x.x9.0.0 – <10
3.0.0, 3.0.1
10.1.5
3.1.0 – 3.1.3
11.2.11 || ^12.0.4
3.2.0, 3.3.0
11.2.11 || ^12.0.4 || ^13.0.0
3.4.2, 3.5.0
For anything beyond this table, check compatibility directly against the ngx-scanner README.
Wire up the module
import { VerifyModule } from 'vc-verification';
import { ZXingScannerModule } from '@zxing/ngx-scanner'; // not required >=0.0.13
import * as configData from '../assets/config.json';
@NgModule({
imports: [
VerifyModule.forChild(configData),
ZXingScannerModule, // not required >=0.0.13
],
})
export class AppModule {}Using the module
Drop <sb-vc-verification></sb-vc-verification> into app.component.html.
To customize labels/messages, pass an item input (showResult array of {title, path} entries, plus copy strings like scanNote, certificateTitle, etc.).
From v10, showResult entries also support a type: 'date' formatter and a removeStr value-stripping option.
For a fully custom UI, import VerifyService from 'verify-module' and call scanSuccessHandler(event).
Available methods:
enableScanner()— toggle scanner visibilityscanSuccessHandler($event)— verify scanned data
Scanners
ZXING_QRCODE
pre-0.0.13
Deprecated; struggles with large-payload QRs
ZBAR_QRCODE
0.0.13 onward
Handles large payloads better
Set via the scanner_type property. Override .vc-btnPrimary in your stylesheet to change the button color.
Last updated