Protect, Track & Control Data.
Anywhere. Anytime.

Get started in JavaScript, Node.js, Python, or C++.

Client-side JS Decryption

After authenticating, you can decrypt a file with just a few lines of code:

<!DOCTYPE html>
<html>
<head>
    <title>Virtru SDK for JavaScript - Sample Application</title>
    <link href="https://sdk.virtru.com/js/latest/auth-widget/index.css" rel="stylesheet"/>
    <script src="https://sdk.virtru.com/js/latest/auth-widget/index.js"></script>
    <script src="https://sdk.virtru.com/js/1.6.11/virtru-sdk.min.js"></script>
</head>

<body>
  <div id="virtru-auth-widget-mount"></div>
  <script type="text/javascript">
    async function afterAuth(email) {
      // Run all client code from here. 
      // This will only be called when the user is successfully authenticated.
      const client = new Virtru.Client({email});      
      const decryptParams = new Virtru.DecryptParamsBuilder()
        .withFileSource('/tmp/statement.pdf.tdf3.html')
        .build();
      
      stream = await client.decrypt(decryptParams);
      await stream.toFile('/tmp/statement.pdf');
    }
    // Set up the auth widget.
    Virtru.AuthWidget('virtru-auth-widget-mount', {afterAuth});
  </script>
</body>
</html>

You (or your app's users) can also decrypt files using Virtru's Secure Reader.

Decrypting Watermarked Files

Please note that watermarked files cannot be decrypted using the Virtru SDK. You or your end users can still decrypt files using the Virtru Secure Reader.

Updated 14 days ago


Client-side JS Decryption


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.