Skip to main content
This guide provides a conceptual overview of OneSDK integration with basic code examples. The code snippets shown are illustrative and need to be adapted into your specific framework and application architecture. For complete, working examples:

Core Modules Overview

Individual Module

Complete KYC workflow for individual verification, including document handling, address verification, and profile management.

Biometrics Module

Advanced biometric verification capabilities including facial recognition, liveness detection, and matching.

OCR Module

Intelligent document scanning and data extraction for IDs, passports, and other verification documents.

IDV Module

Comprehensive identity document verification with support for multiple document types across jurisdictions.

eKYC Form Module

Customizable electronic Know Your Customer forms with built-in validation and compliance checks.

Fraud Detection Module

Real-time fraud prevention and detection across multiple risk vectors.

OneSDK Modules Data Capture Flow

OneSDK modules data capture flow diagram

Quick Integration Guide

1

Install OneSDK

npm install @frankieone/one-sdk
2

Initialize the SDK

Note: The sample code below is just an example. Never generate tokens on the frontend — doing so can expose your credentials. Always generate tokens securely on your backend and pass them to your app as needed.
import OneSdk from "@frankieone/one-sdk";
// fetch your token
const tokenResultRaw = await fetch(
  "https://backend.kycaml.uat.frankiefinancial.io/auth/v2/machine-session",
  {
    method: "POST",
    headers: {
      authorization: "machine " + btoa(`${CUSTOMER_ID}:${API_KEY}`),
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      permissions: {
        preset: "one-sdk",
        // you can pass either your own unique customer reference
        // or if entity already created/existed, you can pass it's ID here
        reference: "customer-reference",
        entityId: "abc-def-ghi",
      },
    }),
  },
);

const oneSdk = await OneSdk({
  session: tokenResultRaw,
  mode: "production",
  recipe: {
    ocr: {
      maxDocumentCount: 3,
    },
  },
});
3

Configure Modules

// Example: Initialize Individual and Biometrics modules
const individual = oneSdk.individual();
const biometrics = oneSdk.component("biometrics");
4

Start Verification

// Example: Mounting Biometrics Component
biometrics.mount("#bio-el");

biometrics.on("detection_complete", (event) => {
  console.log("Biometric capture completed");
});

biometrics.on("results", (results) => {
  console.log("Verification results:", results);
});

Implementation Best Practices

try {
  await individual.submit();
} catch (error) {
  if (error.code === 'CONSENT_REQUIRED') {
    // Handle missing consent
  } else if (error.code === 'VALIDATION_ERROR') {
    // Handle validation errors
  }
}
// Example: Coordinated verification flow
const verifyUser = async () => {
  // 1. Capture basic information
  await individual.setProfileType('standard_kyc');

  // 2. Perform document verification
  const docResult = await idv.verifyDocument();

  // 3. Run biometric checks
  const bioResult = await biometrics.verifyFace();

  // 4. Submit for final verification
  return individual.submit();
};
Initialize modules only when needed and release resources after use. This is especially important for camera-based operations in the Biometrics and OCR modules.

Common Integration Scenarios

const basicKyc = async () => {
  const individual = oneSdk.individual();
  const idv = oneSdk.idv();

  await individual.addConsent('general');
  await idv.captureDocument('PASSPORT');
  return individual.submit();
};
Each module can be used independently or as part of a comprehensive verification flow. Check individual module documentation for detailed implementation guidelines.

Content Security Policy (CSP) Settings

You may need to adjust your Content Security Policy (CSP) settings to allow vendors’ scripts and resources to load correctly. Below are the additional CSP rules required based on the vendor you are integrating with:

API Reference

Detailed API documentation for all OneSDK modules and methods.

Migration Guide

Guide for upgrading from previous versions of OneSDK.

Examples Repository

Sample implementations and integration patterns.

Support Portal

Technical support and implementation assistance.