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
- Installation
- Android setup
- iOS setup
- Initialize the SDK and run a flow
- Sample app
- Troubleshooting
- Related documentation
Prerequisites
| Tool | Version | Notes |
|---|---|---|
| Node.js | 18+ | For the Cordova CLI and your app |
| Cordova CLI | 11+ | npm install -g cordova |
| Android Studio / SDK | API 21+, compileSdk 35, Java 11+ | For Android builds |
| Xcode | iOS 13+ target | For iOS builds (macOS only) |
| Incode API credentials | — | API key and base URL, provided by Incode |
| GitHub token | — | Personal 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-cameraIf you use the geolocation module, add the geolocation plugin as well:
cordova plugin add cordova-plugin-geolocationThen 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 onlyAndroid setup
Android resolves the Incode native SDK from Incode's GitHub Maven package repository, which requires authentication:
- Create a GitHub personal access token with the
read:packagesscope. - Expose it to the build as
GITHUB_USERNAMEandGITHUB_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.1Initialize 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 --deviceTroubleshooting
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.1iOS: 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
- Common Implementation Patterns — three end-to-end integration patterns
- API Reference — every public JavaScript API
- Modules — capture and validation modules
- Customization — theming, strings, localization, UX config
- Known Issues — documented issues and workarounds
