npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@trulioo/kyc-documents

v3.0.49

Published

Trulioo KYC-Documents Javascript SDK

Readme

@trulioo/kyc-documents

Trulioo KYC-Documents Javascript SDK

For more information, see our Documentation.

Info

Some US states impose obligations on businesses that collect and use “biometric identifiers” and/or “biometric information”, which may include facial scan data extracted from photos during a document verification transaction. One such law is the Illinois Biometric Information Privacy Act (“BIPA”). A business required to comply with BIPA is under obligations to, among other things, ensure that it informs the individual of the purpose of the collection and obtain consent. Accordingly, we require a notice and consent mechanism be implemented for all document verification transactions, and our customers using our API must provide us with confirmation via API whether an individual is located in the United States and has consented to the transaction in the prescribed manner. We also strongly encourage all of our customers to consult with legal counsel to ensure their own compliance with such laws.

For more information about the required notice and consent mechanism, please refer to our Service Specific Terms for Document Verification.

Install and Usage

HTML

Create an HTML element where the SDK UI should be rendered:

<div id="trulioo-sdk"></div>

JS

Import the Javascript modules and set up the SDK:

import {Trulioo, EventBuilder, ListenerCallback, Response} from "@trulioo/kyc-documents"

const elementID = "trulioo-sdk" // The HTML element id to attach to
const shortCode = "sample-short-code" // Set the obtained short code from the Trulioo Customer API

// Set up callbacks to get results and debugging errors
const callbacks = new ListenerCallback({
    onComplete: (success: Response.Success) => {
        console.info(`Verification Successful: ${success.transactionId} `)
    },
    onError: (error: Response.Error) => {
        console.error(`Verification Failed with Error Code: ${error.code}, Reason: ${error.message}`)
    },
    onException: (exception: Response.Exception) => {
        console.error("Verification Failed with Exception:", exception)
    }
})

const events = new EventBuilder()
const callbackOption = events.setCallbacks(callbacks)

// Initialize the SDK with the shortcode
const trulioo = new Trulioo()
trulioo.initialize(shortCode)
    .then(complete => {
        console.info("Initialize complete:", complete)
        // Launch the UI with the provided HTML element ID
        trulioo.launch(elementID, callbackOption)
            .then(success => {
                console.info("Launch success:", success)
            })
    })
    .catch(error =>
        console.error("Error:", error)
    )

Note: The SDK will import additional css files automatically. Be sure to not exclude the css files contained in the @trulioo/kyc-documents node_modules directory from your web app configuration if you are using webpack css-loader or something similar.


Customization

The SDK supports customization options that allow you to tailor the user experience. You can configure settings such as language locale and themes. All customization is managed through the Customer API at the time you create a transaction. Once the short code is provided to the SDK, it will automatically render using the configured locale and theme.

For details on how to configure these options, see the Customer API documentation.


Desktop to Mobile Workflow

The SDK also supports cross-device document capture.
When a user begins the verification flow on a desktop browser, they will be shown a QR code that can be scanned with their mobile phone. This allows them to seamlessly continue the capture process using their phone’s camera. After completing the document capture on mobile, the user is automatically redirected back to their desktop session to continue and complete the verification flow.

For details on how to configure these options, see the Customer API documentation.


Utilize the SDK from a CDN

In your project, you can import the Trulioo SDK:

import truliooKYC from "https://cdn.jsdelivr.net/npm/@trulioo/kyc-documents/+esm"

You will now have full access to the SDK via your import, without any extra configuration steps needed. The above URL will get you the latest version of the SDK. If you want to use a more specific version for the SDK, you can do https://cdn.jsdelivr.net/npm/@trulioo/kyc-documents@VERSION_NUMBER/+esm and replace the VERSION_NUMBER to your choice.