> For the complete documentation index, see [llms.txt](https://rc.sunbird.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rc.sunbird.org/use/developer-guide/vc-verification-module.md).

# VC Verification Module

A common library for VC verification, usable across Sunbird RC frontends. Scans QR codes inside Angular apps.

<a href="https://github.com/Sunbird-RC/vc-verification" class="button primary" data-icon="github">View the source on GitHub</a>

{% stepper %}
{% step %}

### Install the library

```bash
npm i vc-verification
```

{% endstep %}

{% step %}

### 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:

```bash
npm i @zxing/ngx-scanner@vx.x.x
```

| Angular Version                   | ngx-scanner version |
| --------------------------------- | ------------------- |
| 9.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](https://github.com/zxing-js/ngx-scanner#readme).
{% endstep %}

{% step %}

### Add the zbar-wasm script

{% code title="index.html" %}

```html
<script src="https://cdn.jsdelivr.net/npm/@undecaf/zbar-wasm@0.9.12/dist/index.js"></script>
```

{% endcode %}
{% endstep %}

{% step %}

### Wire up the module

{% code title="app.module.ts" %}

```typescript
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 {}
```

{% endcode %}
{% endstep %}
{% endstepper %}

## Using the module

{% tabs %}
{% tab title="Default scan template" %}
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.
{% endtab %}

{% tab title="Service directly" %}
For a fully custom UI, import `VerifyService` from `'verify-module'` and call `scanSuccessHandler(event)`.

Available methods:

* `enableScanner()` — toggle scanner visibility
* `scanSuccessHandler($event)` — verify scanned data
  {% endtab %}
  {% endtabs %}

## Scanners

| Scanner        | Default in    | Notes                                        |
| -------------- | ------------- | -------------------------------------------- |
| `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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://rc.sunbird.org/use/developer-guide/vc-verification-module.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
