Vlens DI SDK

Introduction :

Vlens DI SDK Package is a Flutter package that provides a simple and easy-to-use way to verify the identity of a user. The package takes a picture of the user's ID (front and back) and a selfie, and then uses advanced machine learning algorithms to verify that the ID is real and that the selfie matches the person in the ID.

The package is useful for a variety of applications, such as:

KYC/AML compliance Fraud prevention User onboarding Age verification The package is easy to use and can be integrated into any Flutter app with just a few lines of code

Installation:

#iOS

Add two rows to the ios/Runner/Info.plist file:

One with the key Privacy - Camera Usage Description and a usage description. If editing Info.plist as text, add: NSCameraUsageDescription your usage description here add:

<key>NSCameraUsageDescription</key>
<string>your usage description here</string>

#Android

Change the minimum Android SDK version to 23 (or higher) in your android/app/build.gradle file. minSdkVersion 23

Add the following permission to your app's manifest, located at android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET"/>

in the App folder Create a Directory named packages Copy the file provided by vlens in the packages folder.

Add the package in pubspec.yaml file under the dependencies :

dependencies:
  flutter:
    sdk: flutter 
  vlens:
    path: packages/vlens

Run the following command to install the package: flutter pub get

Once you have completed these steps, you will be able to use the VLens package in your Flutter app.

Example :

class VlensTrail extends StatefulWidget {
  const VlensTrail({super.key});

  @override
  _VlensTrailState createState() => _VlensTrailState();
}

class _VlensTrailState extends State<VlensTrail> {
  bool? select ;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Stack(
        children: [
          Center(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                GestureDetector(
                  onTap: () async {
                  
                    // Here is how to start the package. This is function that will
                    // start the package and in the bool return true if user passed 
                    //or false if user failed the verification process
                    const Color darkMain = Color(0xff05385B);
                    const Color lightMain = Color(0xff05304D);
                    bool s = await Vlens.instance.startVlensFlow(
                        context: context,
                        apiKey: 'Insert apiKey',
                        secureKey: "Insert secureKey",
                        language: Language.arabic,
                        accessToken: "Insert accessToken",
                        darkMainColor: darkMain,
                        lightMainColor: lightMain);

                    setState(() {
                      select = s;
                    });
                  },
                  child: const Text(
                    "Start Velns",
                    style: TextStyle(fontSize: 22, color: Color(0xff391917)),
                  ),
                ),
                select !=null ?
                Text(
                  "User Verification : $select",
                  style: const TextStyle(fontSize: 22, color: Color(0xff391917)),
                ):const SizedBox.shrink(),
                // result!=null?Image.memory(result!):SizedBox(),
              ],
            ),
          ),
        ],
      ),
    );
  }
}

Last updated