scandoc-ai-components

0.0.99 • Public • Published

ScanDoc-AI

We offer a pure JavaScript package for integrating ScanDoc-AI services.

To get an access token please contact: info@scandoc.ai

HTML integration

run: npm install scandoc-ai-components

An example HTML page integration:

<!DOCTYPE html>
<html>
<head>
  <title>ScanDoc-AI Demo</title>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <style>
    :root {
        display: flex;
        flex: 1;
        flex-direction: column;
        height: 100vh;
        width: 100vw;
    }

    html, body {
        display: flex;
        flex: 1;
        flex-direction: column;
        font-family: "Roboto", impact, condensed, sans-serif;
        background-color: #fefefe;
        box-sizing: border-box;
        font-size: 14px;
        align-items: center;
        
    }
  </style>
</head>
<body>
  <div id="test">Loading video...</div>

  <script src="scandoc.js"></script>
  <script>
    const key = '';  // Use the key provided by our team
    createScanDocAIConfig(key, "test");

    setScanDocAIConfig({
      SHOULD_RETURN_DOCUMENT_IMAGE: true,
      SHOULD_RETURN_FACE_IF_DETECTED: true,
      SHOULD_RETURN_SIGNATURE_IF_DETECTED: true,
      SKIP_DOCUMENT_SIZE_CHECK: true,
      MAX_SCAN_DURATION_MS: 15000,
      MAX_UNSUPPORTED_ATTEMPTS: 5,
    });

    const extractionVideo = getExtractionVideo(function (result) {
        console.log("Extraction Result:", result);
        if (result.success) {
            extractionVideo.reset();
            extractionVideo.startVideo();
        } else {
            extractionVideo.reset();
            extractionVideo.startVideo();
        }
    });

    const html = extractionVideo.getHTML();
    document.getElementById("test").innerHTML = html;
    extractionVideo.startVideo();
  </script>
</body>
</html>

React integration

run: npm install scandoc-ai-components

An example React integration:

import { useEffect, useMemo } from "react";
import "scandoc-ai-components/dist/index"

const key = "";  // Use the key provided by our team
window.createScanDocAIConfig(key, "test");
window.setScanDocAIConfig({
  SHOULD_RETURN_DOCUMENT_IMAGE: true,
  SHOULD_RETURN_FACE_IF_DETECTED: true,
  SHOULD_RETURN_SIGNATURE_IF_DETECTED: true,
  SKIP_DOCUMENT_SIZE_CHECK: true,
  MAX_SCAN_DURATION_MS: 15000,
  MAX_UNSUPPORTED_ATTEMPTS: 4,
});

const extractionVideo = window.getExtractionVideo(result => {
	console.log("Extraction Result:", result);
  if (result.success) {
      extractionVideo.reset();
      extractionVideo.startVideo();
    } else {
      extractionVideo.reset();
      extractionVideo.startVideo();
    }
});

function App() {
  const html = useMemo(()=>extractionVideo.getHTML(), []);
  useEffect(()=>{
    extractionVideo.startVideo();
  }, []);

  return (
    <div dangerouslySetInnerHTML={{__html: html}} />
  );
}

export default App;

Note

If you have problems integrating the solution please contact: support@scandoc.ai

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.999latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.999
0.0.981
0.0.971
0.0.961
0.0.951
0.0.941
0.0.930
0.0.920
0.0.910
0.0.900
0.0.890
0.0.880
0.0.870
0.0.860
0.0.850
0.0.840
0.0.830
0.0.820
0.0.810
0.0.800
0.0.791
0.0.780
0.0.770
0.0.761
0.0.751
0.0.741
0.0.731
0.0.721
0.0.711
0.0.701
0.0.691
0.0.681
0.0.671
0.0.661
0.0.651
0.0.641
0.0.631
0.0.621
0.0.611
0.0.600
0.0.591
0.0.581
0.0.571
0.0.561
0.0.551
0.0.541
0.0.530
0.0.521
0.0.510
0.0.501
0.0.490
0.0.480
0.0.470
0.0.460
0.0.450
0.0.440
0.0.430
0.0.420
0.0.410
0.0.400
0.0.390
0.0.380
0.0.370
0.0.360
0.0.350
0.0.340
0.0.330
0.0.320
0.0.310
0.0.300
0.0.290
0.0.280
0.0.270
0.0.260
0.0.250
0.0.240
0.0.230
0.0.210
0.0.200
0.0.190
0.0.180
0.0.170
0.0.160
0.0.150
0.0.140
0.0.130
0.0.120
0.0.110
0.0.107
0.0.90
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.30
0.0.20
0.0.10
0.0.00

Package Sidebar

Install

npm i scandoc-ai-components

Weekly Downloads

40

Version

0.0.99

License

ISC

Unpacked Size

23 MB

Total Files

7

Last publish

Collaborators

  • helena-datablast