Skip to main content
Quick Integration Example
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';

const tokenResultRaw = await fetch(
  'https://backend.kycaml.uat.frankiefinancial.io/auth/v2/machine-session',
  {
    method: 'POST',
    headers: {  // Encode credentials as base64 for authorization header
      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 its ID here
        reference: "customer-reference",
        entityId: "abc-def-ghi"
      },
    }),
  }
);

// Initialize OneSDK with configuration
const oneSdk = await OneSdk({ // Pass the auth token response
  session: tokenResultRaw,    // Set environment mode
  mode: "production",
  recipe: {
    ocr: {
      maxDocumentCount: 3,    // Allow up to 3 document scans
    }
  }
});
Visit our npm package page for the latest version and detailed API documentation.

Technical Requirements

Frontend Knowledge

  • Frontend frameworks (React, Vue, Angular)
  • NPM

Dev Environment

  • Node.js 18+
  • TypeScript 5+

Getting Started

Always use environment-specific credentials and never commit API keys to version control.
1

Obtain Your Credentials

You’ll need the following for both UAT and Production:
- Customer ID
- API Keys
Don’t have credentials? Contact FrankieOne Support to get started.
2

Get OneSDK on your Web App

Our SDK supports two integration methods to fit your development workflow, using CDN and NPM.
Use this method if you’re working with plain HTML/JavaScript or as a fallback if you’re having issues with NPM integration.Just include the following script tag in your HTML file:
<html>
  <head>
    <script src="https://assets.frankiefinancial.io/one-sdk/v1/oneSdk.umd.js">
    </script>
  </head>
</html>