Skip to content

Installation

You can get the npm package with the Document Reader web components here: https://www.npmjs.com/package/@regulaforensics/vp-frontend-document-components/

Install via NPM

On the command line, navigate to the root directory of your project:

cd /path/to/project

Run the following command:

npm init
Answer the questions in the command line questionnaire.

Install @regulaforensics/vp-frontend-document-components:

npm i @regulaforensics/vp-frontend-document-components

Create index.html and index.js files in the root directory of the project.

Import @regulaforensics/vp-frontend-document-components into your index.js:

import './node_modules/@regulaforensics/vp-frontend-document-components/dist/main.js';

In index.html, connect index.js and add the name of the component you want to use:

  • <document-reader></document-reader>
  • <camera-snapshot></camera-snapshot>

For example:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>My app</title>
  </head>
  <body>
    <camera-snapshot></camera-snapshot>
    <script type="module" src="index.js"></script>
  </body>
</html>

Install via CDN

Connect the script in your .html file. CDN link: unpkg.com/:package@:version/:file

For example:

<script src="https://unpkg.com/@regulaforensics/vp-frontend-document-components@1.2.0/dist/main.js"></script>

Add the name of the component to the html, as in the example above.

Back to top