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

@surepass/videokyc-rn-sdk

v1.0.1

Published

React Native SDK for integrating SurePass Video KYC — runs the full video-based KYC flow in a secure WebView on Android and iOS.

Readme

SurePass Video KYC React Native SDK

A React Native SDK for integrating SurePass Video KYC verification into your app. It runs the entire video-based KYC flow inside a secure WebView on Android and iOS, exposed as a single imperative call.

Installation

npm install @surepass/videokyc-rn-sdk react-native-webview react-native-permissions react-native-safe-area-context
# iOS
cd ios && pod install

react-native-webview, react-native-permissions, and react-native-safe-area-context are peer dependencies — install them in your app.

Platform setup

The SDK requests camera, microphone, and location at runtime, but it cannot declare them for you.

Android

Add to android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

MODIFY_AUDIO_SETTINGS is required — the WebView's microphone capture (WebRTC) needs it in addition to RECORD_AUDIO. Without it, the verification page reports "microphone access required" even when the OS permission is granted.

Ensure minSdkVersion is 24 or higher in android/build.gradle.

iOS

Add the usage descriptions to ios/<App>/Info.plist:

<key>NSCameraUsageDescription</key>
<string>Camera access is required for video KYC verification.</string>
<key>NSMicrophoneUsageDescription</key>
<string>Microphone access is required for video KYC verification.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Location access is required for video KYC verification.</string>

Enable the react-native-permissions handlers you use by adding this to the top of your ios/Podfile (see the react-native-permissions setup):

require_relative '../node_modules/react-native-permissions/scripts/setup'

setup_permissions([
  'Camera',
  'Microphone',
  'LocationWhenInUse',
])

Set the iOS deployment target to 13.0+ (WKWebView getUserMedia needs a recent iOS; 14.3+ recommended).

Usage

First, mount VideoKycProvider once at your app root (it hosts the verification modal):

import { VideoKycProvider } from '@surepass/videokyc-rn-sdk';

export default function App() {
  return (
    <VideoKycProvider>
      {/* the rest of your app */}
    </VideoKycProvider>
  );
}

Then start the flow from anywhere:

import {
  startSurepassVideoKyc,
  Env,
  VideoKycStatus,
  type VideoKycModel,
} from '@surepass/videokyc-rn-sdk';

const result = await startSurepassVideoKyc({
  token: 'your_surepass_api_token',
  env: Env.sandbox, // or Env.prod
  workflowId: 'your_workflow_id',
  email: '[email protected]',
  fullName: 'John Doe',
  mobileNumber: '9876543210', // 10-digit number, no country-code prefix
  scriptParameterValue: {
    // Optional — custom params forwarded to your workflow script. Use the keys
    // your workflow expects; omit entirely if it takes none.
    name: 'john doe',
    loan_type: 'home loan',
    company: 'spaceX',
  },
  onInitialized: (model: VideoKycModel) => {
    // Fired once the Video KYC session is initialized.
    console.log(`User: ${model.userId}, session: ${model.sessionId}`);
  },
});

switch (result?.status) {
  case VideoKycStatus.success:
    console.log(`KYC completed — session ${result.sessionId}`);
    break;
  case VideoKycStatus.cancelled:
    console.log('KYC cancelled by the user');
    break;
  case VideoKycStatus.error:
    console.log(`KYC error: ${result.errorMessage}`);
    break;
  default: // undefined/null — dismissed before a terminal status
    console.log('Flow dismissed before reaching a terminal status');
}

startSurepassVideoKyc presents the flow in a full-screen modal (hosted by VideoKycProvider) and resolves when it ends. If the provider isn't mounted, the call resolves with VideoKycStatus.error.

Parameters

| Parameter | Required | Description | | --------------- | :------: | -------------------------------------------------------- | | token | ✅ | Your SurePass API authentication token. | | env | ✅ | Env.sandbox or Env.prod. | | workflowId | ✅ | Your SurePass workflow id. | | email | ✅ | User's email address. | | fullName | ✅ | User's full name. | | mobileNumber | ✅ | User's 10-digit mobile number (no country-code prefix). | | scriptParameterValue | — | Custom key/value params forwarded to your workflow script (sent as script_parameter_value). Keys are defined by your workflow. | | onInitialized | — | Callback receiving the VideoKycModel on initialization.|

The VideoKycModel contains userId, workflowId, sessionId, videoKycUrl, and the optional workflowSessionId, eventType, and signature.

scriptParameterValue is send-only: it is forwarded to your workflow script via the create-user call and is not returned through onInitialized or the result. Your app already supplies these values, so keep them in your own state if you need them after the flow.

Result

startSurepassVideoKyc() resolves to a SurepassVideoKycResult | null. It is null if dismissed before a terminal status; otherwise:

  • statusVideoKycStatus.success, cancelled, or error. (VideoKycStatus.failed exists in the enum but is reserved and not currently emitted — failures surface as error.)
  • sessionId — the session id for tracking (when available).
  • errorMessage — populated for setup/API failures when status is error.

Verify completion server-side. A success result means the in-flow verification reached its completion redirect on the device. Treat it as advisory and confirm the final KYC outcome server-side (via the SurePass APIs/webhooks using sessionId) before granting access.

How it works

When you call startSurepassVideoKyc, the SDK requests permissions, makes two authenticated SurePass API calls (create-user, then initiate-video-kyc), and only then opens the WebView. If permissions are denied or either call fails, it resolves with VideoKycStatus.error before any WebView appears — so token and workflowId must be valid for the selected env.

License

Released under the MIT License — see LICENSE.