Skip to content

Content-Security Policy (CSP) Compatible Version

We provide a version of the library, which Content-Security Policy (CSP) compatible and also has better Anti-Debugging techniques. However, the disadvantage of this version is that the protection treats most e2e testing tools as injection and blocks the execution of tests

  1. Install the csp compatible package in your application (replace ./idlive-face-capture-web-csp-compatible.tgz with the path to the provided archive file)

    npm i idlive-face-capture-web-csp-compatible file:./idlive-face-capture-web-csp-compatible.tgz
    
  2. Copy the idlive-capture folder to your public directory

    cp -r ./node_modules/idlive-face-capture-web-csp-compatible/idlive-capture ./path/to/your/public/dir
    
  3. Import the csp compatible package instead of the production version

    import('idlive-face-capture-web-csp-compatible');
    
  4. Additionally load the script from the idlive-capture folder without minification or any modifications. The following options are possible depending on the detector version:

    • Default Face Detector
    <script src="/idlive-capture/face.js"></script>
    
    • IDLive Face Detector
    <script src="/idlive-capture/face-idlf-detector.js"></script>
    
    • Custom Detector
    <script src="/idlive-capture/face-no-detector.js"></script>
    
  5. By default, the library will fetch files from the URL /idlive-capture. You can change this using the sdk_path attribute

    <idlive-face-capture sdk_path="/assets"></idlive-face-capture>
    

Check out example