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

@au10tixorg/secureme-sdk

v4.7.1

Published

A React Native bridge for implementing Secure.me native functionality

Readme

SecureMe SDK

React Native library for SecureMe integration (iOS & Android).

Development

Prerequisites

  • Node.js 14+ and npm
  • React Native development environment
  • For iOS: Xcode and CocoaPods
  • For Android: Android Studio and Java

📖 Documentation

For a comprehensive overview of features, configuration options, and integration steps, please see the Integration Guide (GUIDE.md).


Building the Library

  1. Clone the repository

    git clone <repository-url>
    cd reactnative-secure.me-sdk
  2. Install dependencies

    yarn install
  3. Build the library

    npx react-native-builder-bob build

Clean Rebuild

To perform a complete clean rebuild:

# Clean all build artifacts and dependencies
rm -rf lib node_modules package-lock.json yarn.lock .yarn/cache .yarn/install-state.gz example/node_modules example/package-lock.json example/ios/Pods example/ios/Podfile.lock

# Reinstall and rebuild
yarn install
npx react-native-builder-bob build

Available Scripts

  • yarn run typescript - Type check with TypeScript
  • yarn run lint - Lint code with ESLint
  • npx react-native-builder-bob build - Build the library (via react-native-builder-bob)
  • yarn test - Run tests
  • yarn run example - Run commands in the example app
  • yarn run pods - Install iOS pods for the example app

iOS Setup

1. Install Pods

Go to your project's iOS folder and install dependencies:

cd ios
pod install

Android Setup

1. Minimum SDK Version

Ensure your android/build.gradle has minimum SDK version 21 or higher:

buildscript {
    ext {
        minSdkVersion = 21
    }
}

Usage

Here is a basic example of how to integrate the SDK into your application.

Note: Use Named Import with curly braces { SecuremeSdk }.

import React, { useEffect, useState } from 'react';
import {
  SafeAreaView,
  View,
  Text,
  Button,
  StyleSheet,
  Alert,
  ActivityIndicator,
  Linking,
  Platform,
  PermissionsAndroid,
} from 'react-native';

import { SecuremeSdk, SMFlow, SMConfig } from 'secureme-sdk';

// Define your flow configuration for both platforms
const smFlow: SMFlow = {
  android: {
    sdcFront: { enabled: true, showIntro: true, enableFileUpload: true },
    sdcBack: { enabled: true, enableFileUpload: true, sendFeatureResult: true },
    pfl: { enabled: true, showIntro: true, sendFeatureResult: true },
  },
  ios: {
    sdcFront: {
      showIntro: true,
      enableFileUpload: true,
      sendFeatureResult: true,
      localClassification: false,
    },
    sdcBack: {
      showIntro: true,
      enableFileUpload: true,
      sendFeatureResult: true,
    },
    pfl: {
      showIntro: true,
      sendFeatureResult: true,
    },
  },
};

// Define your configuration for both platforms
const smConfig: SMConfig = {
  android: {
    withPflDetectionDelay: false,
    pflDelaySecs: 0,
    sendResults: true,
  },
  ios: {
    pflDetectionDelayEnabled: false,
    pflDelay: 0.0,
    sendResults: true,
    voiceConsentSessionTime: 20,
  },
};

// Your workflow data from the API
const WORKFLOW_DATA = `{
  "sessionId": "YOUR_SESSION_ID",
  "response": {
    "session": "...",
    "accessToken": "...",
    "assets": [...]
  },
  "statusCode": 200
}`;

const App = () => {
  const [isLoading, setIsLoading] = useState(true);
  const [cameraStatus, setCameraStatus] = useState<boolean>(false);

  const requestCameraAccess = async (): Promise<boolean> => {
    if (Platform.OS === 'android') {
      try {
        const granted = await PermissionsAndroid.request(
          PermissionsAndroid.PERMISSIONS.CAMERA,
          {
            title: 'Camera Permission',
            message: 'This app needs camera access for identity verification.',
            buttonNeutral: 'Ask Me Later',
            buttonNegative: 'Cancel',
            buttonPositive: 'OK',
          }
        );
        return granted === PermissionsAndroid.RESULTS.GRANTED;
      } catch (err) {
        console.warn(err);
        return false;
      }
    } else {
      // iOS - permission handled by SecuremeSdk
      const hasPermission = await SecuremeSdk.requestCameraPermission();
      return hasPermission;
    }
  };

  useEffect(() => {
    const setupSDK = async () => {
      try {
        console.log('🚀 Starting SDK Setup...');

        const hasPermission = await requestCameraAccess();
        console.log('📷 Camera Status:', hasPermission);
        setCameraStatus(hasPermission);
      } catch (error: any) {
        console.error('❌ Setup Failed:', error);
        Alert.alert('Setup Error', error.message || 'Unknown error');
      } finally {
        setIsLoading(false);
      }
    };

    setupSDK();
  }, []);

  const handleStartKit = async () => {
    if (!cameraStatus) {
      Alert.alert(
        'Camera Permission Required',
        'We need camera access to verify your identity.',
        [
          { text: 'Cancel', style: 'cancel' },
          { text: 'Open Settings', onPress: () => Linking.openSettings() },
        ]
      );
      return;
    }

    try {
      console.log('📱 Opening SecureMe Kit...');
      const result = await SecuremeSdk.start(WORKFLOW_DATA, smFlow, smConfig);
      Alert.alert('Success', 'Verification was successful!');
      console.log('🏁 Flow finished with result:', result);
    } catch (error: any) {
      console.error('❌ Failed to open Kit:', error);
      Alert.alert('Error', error.message);
    }
  };

  return (
    <SafeAreaView style={styles.container}>
      <View style={styles.content}>
        <Text style={styles.title}>SecureMe Integration</Text>

        {isLoading ? (
          <View>
            <ActivityIndicator size="large" color="#0000ff" />
            <Text style={styles.loadingText}>
              Checking permissions & initializing...
            </Text>
          </View>
        ) : (
          <View style={styles.infoContainer}>
            <Text style={styles.statusRow}>
              Camera: {cameraStatus ? '✅ Allowed' : '❌ Denied'}
            </Text>

            <View style={styles.buttonContainer}>
              <Button
                title="Start SecureMe"
                onPress={handleStartKit}
                disabled={!cameraStatus}
              />
            </View>
          </View>
        )}
      </View>
    </SafeAreaView>
  );
};

const styles = StyleSheet.create({
  container: { flex: 1, backgroundColor: '#F5F5F5' },
  content: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    padding: 20,
  },
  title: { fontSize: 24, fontWeight: 'bold', marginBottom: 30, color: '#333' },
  loadingText: { marginTop: 10, color: '#666' },
  infoContainer: { width: '100%', alignItems: 'center' },
  statusRow: { fontSize: 16, marginBottom: 10, color: '#444' },
  buttonContainer: { marginTop: 20, width: '100%', marginBottom: 10 },
});

export default App;

API Reference

Methods

requestCameraPermission(): Promise<boolean>

Requests camera permission (iOS only - Android handles via PermissionsAndroid).

Returns: Promise<boolean> - true if permission granted, false otherwise.

const hasPermission = await SecuremeSdk.requestCameraPermission();

start(workFlowResponse: string, flow: SMFlow, config: SMConfig): Promise<any>

Starts the SecureMe verification flow.

Parameters:

  • workFlowResponse (string): JSON string containing session data from your backend
  • flow (SMFlow): Flow configuration for Android and/or iOS
  • config (SMConfig): Additional configuration options for Android and/or iOS

Returns: Promise<any> - Result of the verification flow

const result = await SecuremeSdk.start(WORKFLOW_DATA, smFlow, smConfig);

Types

SMFlow

interface SMFlow {
  android?: AndroidSMFlow;
  ios?: IOSSMFlow;
}

SMConfig

interface SMConfig {
  android?: AndroidSMConfig;
  ios?: IOSSMConfig;
}

For detailed type definitions, see types.ts.

Flow Features

Android Features

  • sdcFront - Front Document Capture
  • sdcBack - Back Document Capture
  • pfl - Passive Face Liveness
  • nfc - NFC Passport Reading
  • poa - Proof of Address
  • videoSession - Video Session
  • voiceConsent - Voice Consent

iOS Features

  • sdcFront - Front Smart Document Capture
  • sdcBack - Back Smart Document Capture
  • pfl - Passive Face Liveness
  • vc - Voice Consent
  • vs - Video Session
  • poa - Proof of Address
  • sdcOcr - OCR Document Capture

Configuration Options

Android Config

{
  pflDelaySecs?: number;
  sendResults?: boolean;
  suspiciousConfig?: AndroidSuspiciousConfigType;
  videoSessionAskUserConsent?: boolean;
  videoSessionConsentTime?: number;
  videoSessionIDTime?: number;
  voiceConsentSessionTime?: number;
  voiceConsentText?: string;
  withPflDetectionDelay?: boolean;
}

iOS Config

{
  pflDetectionDelayEnabled?: boolean;
  pflDelay?: number;
  sendResults?: boolean;
  voiceConsentText?: string;
  voiceConsentSessionTime?: number;
  videoSessionText?: string;
  videoSessionIdSessionDuration?: number;
  videoSessionVoiceSessionDuration?: number;
}

Troubleshooting

iOS

Issue: Pod install fails
Solution: Try cd ios && pod install --repo-update

Issue: Camera permission not working
Solution: Ensure NSCameraUsageDescription is added to Info.plist

Android

Issue: Build fails with dependency conflicts
Solution: Ensure your minSdkVersion is at least 21

Issue: Camera permission denied
Solution: Check that CAMERA permission is declared in AndroidManifest.xml

Error Handling

The SDK can throw the following errors:

Native Module Errors

  • LinkingError — thrown when the native module is not properly linked (native binary missing or pods not installed).
  • PermissionError — thrown when camera permissions are denied or unavailable.
  • ValidationError — thrown when an invalid configuration or workflow payload is provided.

Session Errors

  • SessionInitError — failed to initialize session with provided workflow data.
  • NetworkError — failed to communicate with backend services or token validation failed.

Example Error Handling

Use guarded calls and inspect error messages or types to handle specific cases:

try {
  const result = await SecuremeSdk.start(WORKFLOW_DATA, smFlow, smConfig);
  // handle success result
} catch (error: any) {
  const msg = error && error.message ? error.message.toLowerCase() : '';

  if (msg.includes('link') || msg.includes('linking')) {
    // Native linking problems
    Alert.alert(
      'Linking Error',
      'Native module not linked. Run pod install and rebuild.'
    );
  } else if (msg.includes('permission')) {
    // Permission issues
    Alert.alert(
      'Permission Required',
      'Please enable camera access in settings.'
    );
  } else if (msg.includes('session') || msg.includes('workflow')) {
    // Session / workflow validation
    Alert.alert(
      'Session Error',
      'Invalid workflow data or session init failed.'
    );
  } else if (msg.includes('network') || msg.includes('timeout')) {
    // Network problems
    Alert.alert(
      'Network Error',
      'Communication with the backend failed. Try again later.'
    );
  } else {
    // Fallback
    Alert.alert('Error', error?.message || 'Unknown error occurred');
  }
}

Notes:

  • Native linking errors typically indicate native code not built/installed. For iOS, run cd example/ios && pod install and rebuild.
  • PermissionError means the user denied camera access — prompt to open app settings.
  • ValidationError indicates the provided WORKFLOW data is invalid JSON or missing required fields; validate before calling SDK.
  • Log errors on the native side (Xcode / Logcat) for deeper diagnostics.

License

MIT

Support

For issues and questions, please visit the repository issues page.