Socket
Book a DemoInstallSign in
Socket

react-native-kalapa-zalo-miniapp-ekyc

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-kalapa-zalo-miniapp-ekyc

React Native SDK for Kalapa eKYC integration

latest
Source
npmnpm
Version
1.0.7
Version published
Weekly downloads
1
-50%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-kalapa-ekyc

React Native SDK for Kalapa eKYC integration, providing a seamless way to implement eKYC functionality in your React Native applications.

Installation

Using npm:

npm install react-native-kalapa-ekyc

Using yarn:

yarn add react-native-kalapa-ekyc

iOS Setup

Add the following to your Podfile:

pod 'react-native-kalapa-ekyc', :path => '../node_modules/react-native-kalapa-ekyc'

Then run:

cd ios && pod install

Basic Usage

import KalapaEkyc from 'react-native-kalapa-ekyc';

// Initialize the SDK
const ekyc = new KalapaEkyc({
  clientId: 'YOUR_CLIENT_ID',
  clientSecret: 'YOUR_CLIENT_SECRET',
  environment: 'sandbox' // or 'production'
});

// Start eKYC flow
try {
  const result = await ekyc.startEkyc();
  console.log('eKYC Result:', result);
} catch (error) {
  console.error('eKYC Error:', error);
}

WebView Integration

The SDK provides a WebView-based implementation:

import { WebViewScreen } from 'react-native-kalapa-ekyc';

// In your navigation/component
<WebViewScreen
  clientId="YOUR_CLIENT_ID"
  clientSecret="YOUR_CLIENT_SECRET"
  onComplete={(result) => {
    console.log('WebView eKYC completed:', result);
  }}
  onError={(error) => {
    console.error('WebView eKYC error:', error);
  }}
/>

API Reference

KalapaEkyc Class

Constructor Options

interface KalapaEkycOptions {
  clientId: string;
  clientSecret: string;
  environment: 'sandbox' | 'production';
  timeout?: number;
  language?: 'en' | 'vi';
}

Methods

  • startEkyc(): Starts the eKYC flow
  • getSessionStatus(sessionId: string): Get status of an eKYC session
  • validateSession(sessionId: string): Validate an eKYC session

WebViewScreen Component

Props

interface WebViewScreenProps {
  clientId: string;
  clientSecret: string;
  onComplete: (result: EkycResult) => void;
  onError: (error: Error) => void;
  language?: 'en' | 'vi';
  theme?: 'light' | 'dark';
}

Response Types

interface EkycResult {
  sessionId: string;
  status: 'completed' | 'pending' | 'failed';
  data?: {
    idCard?: IdCardData;
    face?: FaceData;
    verification?: VerificationResult;
  };
}

interface IdCardData {
  type: string;
  number: string;
  name: string;
  dob: string;
  // ... other ID card fields
}

Error Handling

The SDK throws typed errors that you can handle:

try {
  await ekyc.startEkyc();
} catch (error) {
  if (error instanceof KalapaEkycError) {
    // Handle SDK-specific errors
    console.error(error.code, error.message);
  } else {
    // Handle other errors
    console.error(error);
  }
}

Configuration Options

OptionTypeDescriptionDefault
clientIdstringYour Kalapa client IDRequired
clientSecretstringYour Kalapa client secretRequired
environmentstring'sandbox' or 'production''sandbox'
timeoutnumberRequest timeout in ms30000
languagestring'en' or 'vi''en'

Development

  • Clone the repository
  • Install dependencies:
yarn install
  • Run the example app:
yarn example

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Support

For support, please contact support@kalapa.vn or visit our documentation.

Keywords

react-native

FAQs

Package last updated on 01 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts