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 🙏

© 2026 – Pkg Stats / Ryan Hefner

docupass-react-native

v0.2.3

Published

Pure JavaScript event API and React Native KYCScreen for ID Analyzer DocuPass KYC.

Readme

DocuPass React Native SDK

Pure JavaScript React Native SDK for running an ID Analyzer DocuPass verification flow inside an app.

The package includes:

  • A ready-to-use React Native KYCScreen
  • A headless event/session API for custom UI
  • DocuPass API transport, authorization handling, and task routing
  • Phone, custom form, document, face, contract, pending-party, completed, and failed flow handling
  • Optional adapter hooks for app-owned camera, liveness, and signature capture

Create DocuPass sessions on your backend. The mobile app should receive only the short-lived reference; never ship an ID Analyzer API key in React Native code. The finish callback is a UI signal only. Your backend webhook or server-side result lookup remains the source of truth.

Install

npm install docupass-react-native

This package is pure JS and does not autolink native modules. If your app uses the quick UI's camera/liveness/signature adapter hooks, install and configure the camera or drawing library you choose in the host app.

For the bundled VisionCamera document/face capture and signature canvas adapter:

npm install docupass-react-native \
  react-native-vision-camera \
  react-native-vision-camera-face-detector \
  react-native-nitro-modules \
  react-native-nitro-image \
  react-native-signature-canvas \
  react-native-webview

Then render the native-capture wrapper from the SDK subpath:

import { DocupassNativeCaptureScreen } from 'docupass-react-native/native-capture';

export function VerifyScreen({ reference }: { reference: string }) {
  return <DocupassNativeCaptureScreen reference={reference} />;
}

Document capture uses react-native-vision-camera; face actions use react-native-vision-camera-face-detector; signature capture uses react-native-signature-canvas. MediaPipe is not used by this package.

For Expo prebuild projects, the included config plugin can add camera permission strings:

{
  "expo": {
    "plugins": [
      [
        "docupass-react-native",
        {
          "cameraPermission": "Camera access is required for identity verification."
        }
      ]
    ]
  }
}

Quick UI

import { KYCScreen } from 'docupass-react-native';

export function VerifyScreen({ reference }: { reference: string }) {
  return (
    <KYCScreen
      reference={reference}
      onFinish={(result) => {
        console.log(result.sessionId);
      }}
      onBackAtFirstStep={() => {
        // Close this screen in your navigator.
      }}
    />
  );
}

KYCScreen handles loading, server task routing, country and document type selection, phone OTP, custom forms, document upload, face upload, contract signatures, pending-party refresh, back navigation, and terminal screens.

Because this SDK is pure JS, capture is adapter-based:

<KYCScreen
  reference={reference}
  captureDocumentSide={async (side, context) => {
    // Open your app's camera and return raw JPEG base64 without a data URL prefix.
    return captureDocumentWithYourCamera(side, context);
  }}
  captureFace={async (actions) => {
    // Run your liveness UI and return raw JPEG base64 frames.
    return captureFaceFrames(actions);
  }}
  collectContractSignature={async (field) => {
    // Return data:image/png;base64,...
    return openSignaturePad(field);
  }}
/>

If an adapter is not supplied, the quick UI shows manual base64/data URL fields. That keeps the SDK buildable and testable in apps that want to provide capture later or build fully custom screens.

Event API

import { DocupassKycSession, docupassConfigFromReference } from 'docupass-react-native';

const session = new DocupassKycSession(docupassConfigFromReference(reference));

const subscription = session.subscribe((state) => {
  switch (state.event.kind) {
    case 'documentCountrySelection':
      console.log(state.event.countries);
      break;
    case 'completed':
      console.log(state.event.result.sessionId);
      break;
  }
});

session.start();

// When the owner unmounts:
subscription.close();
session.close();

Session methods match the native SDK flow:

  • start(), refresh(), back(), clearError(), restart(), close()
  • sendPhoneCode(number, type), verifyPhoneCode(number, code)
  • saveCustomForm(answers)
  • selectDocumentCountry(countryCode), selectDocumentType(documentTypeCode)
  • uploadDocument(frontBase64, backBase64)
  • uploadFace(faceBase64List)
  • submitContract(signatures)

Do not call step-specific methods before the matching event is emitted. While state.isBusy is true, keep UI controls disabled.

Configuration

import { docupassConfigFromReference } from 'docupass-react-native';

const geolocation = 'latitude,longitude,accuracy';
const config = docupassConfigFromReference(
  reference,
  partyId,
  geolocation,
);

EU references use https://api2-eu.idanalyzer.com/docupassappv3; all other references use the US endpoint.

Authorization is generated automatically:

DOCUPASS <reference>
DOCUPASS <reference> <partyId>
DOCUPASS_SESSION <sessionId>

After get_action returns a sessionId, later requests use DOCUPASS_SESSION.

Local Demo Mode

Set enabled={false} or apiConfig.enabled = false to run the local fallback workflow without calling the DocuPass API. This is useful for demo apps and CI build checks.