OneSDK Implementation Guide

From document verification to fraud prevention, OneSDK handles the complexity of multiple vendor integrations while providing a unified API surface

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

OneSDK Modules Data Capture Flow

OneSDK modules data capture flow diagram
Data capture flow diagram showing module selection options

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.

1import OneSDK from "@frankieone/one-sdk";
2
3// fetch your token
4const tokenResultRaw = await fetch(
5 "https://backend.kycaml.uat.frankiefinancial.io/auth/v2/machine-session",
6 {
7 method: "POST",
8 headers: {
9 authorization: "machine " + btoa(`${CUSTOMER_ID}:${API_KEY}`),
10 "Content-Type": "application/json",
11 },
12 body: JSON.stringify({
13 permissions: {
14 preset: "one-sdk",
15 // you can pass either your own unique customer reference
16 // or if entity already created/existed, you can pass it's ID here
17 reference: "customer-reference",
18 entityId: "abc-def-ghi",
19 },
20 }),
21 },
22);
23
24const oneSdk = await OneSDK({
25 session: tokenResultRaw,
26 mode: "production",
27 recipe: {
28 ocr: {
29 maxDocumentCount: 3,
30 },
31 },
32});
3

Configure Modules

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

Start Verification

1// Example: Mounting Biometrics Component
2biometrics.mount("#bio-el");
3
4biometrics.on("detection_complete", (event) => {
5 console.log("Biometric capture completed");
6});
7
8biometrics.on("results", (results) => {
9 console.log("Verification results:", results);
10});

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: