Getting Started

Integrate the Incode Onboarding Cordova Plugin into your Cordova, Capacitor, or Ionic app. This guide covers prerequisites, installation, per-platform setup, and running your first onboarding flow.

Contents

Prerequisites

ToolVersionNotes
Node.js18+For the Cordova CLI and your app
Cordova CLI11+npm install -g cordova
Android Studio / SDKAPI 21+, compileSdk 35, Java 11+For Android builds
XcodeiOS 13+ targetFor iOS builds (macOS only)
Incode API credentialsAPI key and base URL, provided by Incode
GitHub tokenPersonal access token with read:packages, for Incode's Android Maven repository

Installation

Install the Incode Onboarding Cordova Plugin from the npm package id:

cordova plugin add incode-cordova-plugin

…or directly from the release repository:

cordova plugin add https://github.com/Incode-Technologies-Example-Repos/CordovaPluginReleases.git

…or, for the NFC variant (NFC-capable hardware required):

cordova plugin add "https://github.com/Incode-Technologies-Example-Repos/CordovaPluginReleases.git#release/[VERSION]-nfc"

The SDK uses the camera to capture ID and face, so add the camera plugin:

cordova plugin add cordova-plugin-camera

If you use the geolocation module, add the geolocation plugin as well:

cordova plugin add cordova-plugin-geolocation

Then add the platforms you target. Pin the platform versions that are confirmed compatible with the SDK rather than relying on whatever is installed by default:

cordova platform add android@^14.0.1
cordova platform add ios@^7.1.1   # macOS only

Android setup

Android resolves the Incode native SDK from Incode's GitHub Maven package repository, which requires authentication:

  1. Create a GitHub personal access token with the read:packages scope.
  2. Expose it to the build as GITHUB_USERNAME and GITHUB_TOKEN — either as environment variables or as Gradle properties (github_username / github_token).

The Maven repository that hosts the native dependency is:

https://maven.pkg.github.com/Incode-Technologies-Example-Repos/android-omni-packages

For the complete dependency-source configuration, see the Additional Steps for Android section on the Cordova SDK page.

iOS setup

iOS native dependencies are managed through CocoaPods and are installed when you add the iOS platform. If pod installation fails, run pod repo update and re-add the platform:

cordova platform rm ios && cordova platform add ios@^7.1.1

Initialize the SDK and run a flow

On startup, call initializeSDK with your Incode API key and base URL, then start an onboarding flow:

cordova.exec(
  function () {
    // SDK ready — start onboarding
    cordova.exec(
      function (result) { console.log("Onboarding completed:", result); },
      function (error) { console.log("Onboarding error:", error); },
      "Cplugin",
      "startOnboarding",
      [
        { region: "ALL" },                 // sessionConfig
        [{ module: "addId" }, { module: "addSelfieScan" }, { module: "addFaceMatch" }], // flowConfig
        { recordSession: "false" }         // recordSessionConfig
      ]
    );
  },
  function (err) { console.log("Init error:", err); },
  "Cplugin",
  "initializeSDK",
  ["YOUR_API_KEY", "https://your.api.url", "true", "false", "false", "false", null, null, { enabled: false, forceSSLPinning: false }]
);

Keep all credentials out of source control. For complete, copy-paste integration patterns, see Common Implementation Patterns. For every method and its full signature, see the API Reference. For the available capture/validation modules, see Modules.

Sample app

A complete, runnable example is available in the CordovaSampleApp repository. Clone it, add your Incode credentials, then build and run on a device:

cordova run android --device
# or
cordova run ios --device

Troubleshooting

Android: cannot resolve the Incode SDK

Verify GITHUB_USERNAME / GITHUB_TOKEN are set and the token has package read access, then re-add the platform:

cordova platform rm android && cordova platform add android@^14.0.1

iOS: CocoaPods install fails

Run pod repo update, then re-add the iOS platform.

Plugin changes not reflected

Run cordova prepare, or remove and re-add the plugin.

Related documentation