kenal_ekyc_sdk 1.0.1
kenal_ekyc_sdk: ^1.0.1 copied to clipboard
Kenal eKYC SDK for Flutter applications
kenal_ekyc_demo_flutter #
A Flutter demo for quickly integrating and embedding the Kenal eKYC flow using KenalWebView.
Installation #
Add the SDK package to your pubspec.yaml:
dependencies:
kenal_ekyc_sdk: ^1.0.0
Then run:
flutter pub get
Quick Start #
-
Initialize the client (e.g. in your app’s entry point or screen):
import 'package:kenal_ekyc_sdk/kenal_ekyc_sdk.dart'; void main() { final config = KenalClientConfig( apiKey: 'YOUR_API_KEY', environment: 'sandbox', // or 'production' ); KenalClient.initialize(config); runApp(const MyApp()); } -
Launch the eKYC process (e.g. for MyKad) and capture the URL:
import 'package:kenal_ekyc_sdk/kenal_ekyc_sdk.dart'; final myKadData = await MyKad.start( MyKadParams( name: 'John Doe', // or omit when useOCRForData = true idNumber: '900101014321', refId: 'REF12345', useOCRForData: false, ), ); final ekycUrl = myKadData.fullURL; -
Embed the WebView using
KenalWebView:import 'package:kenal_ekyc_sdk/kenal_ekyc_sdk.dart'; // In your widget build: KenalWebView( url: ekycUrl, onComplete: (data) { // handle success data }, onError: (error) { // handle errors }, onMessage: (message) { // handle custom messages }, );
Permissions Setup #
Android (AndroidManifest.xml) #
<uses-permission android:name="android.permission.CAMERA"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
iOS (Info.plist) #
<key>NSCameraUsageDescription</key>
<string>Camera is required for eKYC verification</string>
<key>NSMicrophoneUsageDescription</key>
<string>Microphone is required for eKYC verification</string>