{"id":28788959,"url":"https://github.com/iproov/kotlin-multiplatform","last_synced_at":"2026-06-10T09:31:50.077Z","repository":{"id":299424620,"uuid":"979931019","full_name":"iProov/kotlin-multiplatform","owner":"iProov","description":null,"archived":false,"fork":false,"pushed_at":"2025-12-04T00:27:23.000Z","size":7500,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-07T06:25:09.275Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iProov.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-08T09:45:39.000Z","updated_at":"2025-12-04T00:25:28.000Z","dependencies_parsed_at":"2025-12-05T01:02:10.643Z","dependency_job_id":null,"html_url":"https://github.com/iProov/kotlin-multiplatform","commit_stats":null,"previous_names":["iproov/kotlin-multiplatform"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/iProov/kotlin-multiplatform","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iProov%2Fkotlin-multiplatform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iProov%2Fkotlin-multiplatform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iProov%2Fkotlin-multiplatform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iProov%2Fkotlin-multiplatform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iProov","download_url":"https://codeload.github.com/iProov/kotlin-multiplatform/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iProov%2Fkotlin-multiplatform/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34146871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-17T21:05:18.995Z","updated_at":"2026-06-10T09:31:50.047Z","avatar_url":"https://github.com/iProov.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"![iProov: Flexible authentication for identity assurance](https://github.com/iProov/kotlin-multiplatform/blob/main/banner.jpg)\n# iProov Face Kotlin Multiplatform SDK\n\n## Introduction\n\nThe iProov Face Kotlin Multiplatform SDK wraps iProov's native [iOS](https://github.com/iProov/ios) (Swift) and [Android](https://github.com/iProov/android) (Java) SDKs behind a Kotlin Multiplatform interface for use from within your Kotlin Multiplatform iOS or Android app.\n\nWe also provide an API Client written in Kotlin Multiplatform to call our [REST API v2](https://eu.rp.secure.iproov.me/docs.html) from the Kotlin Multiplatform Example app, which can be used to request tokens directly from the iProov API (note that this is not a secure way of getting tokens, and should only be used for demo/debugging purposes).\n\n### Requirements\n\n- Kotlin Multiplatform SDK 2.2.21 and above\n- iOS 15 and above\n- Android API Level 26 (Android 8 Oreo) and above\n\n## Repository contents\n\nThe iProov Kotlin Multiplatform SDK is provided via this repository, which contains the following:\n\n- **README.md** - This document\n- **sdk/commonMain/api** - iProov Kotlin Multiplatform SDK Plugin.\n- **sdk/commonMain/api_client** - The Kotlin Multiplatform iProov API Client\n- **ExampleApp/commonMain** - The Kotlin Multiplatform demonstration Example App.\n\n## IOS Configuration\n\n1. Select `File` → `Add Packages…` in the Xcode menu bar.\n\n2. Search for the iProov SDK package using the following URL:\n\n   ```\n   https://github.com/iProov/ios\n   ```\n\n3. Set the _version_ to be as same iOS SDK version used in the Kotlin Multiplatform SDK.\n\n4. Click _Add Package_ to add the iProov SDK to your Xcode project and then click again to confirm.\n\n5. You must also add a `NSCameraUsageDescription` to your iOS app's Info.plist, with the reason why your app requires camera access (e.g. “To iProov you in order to verify your identity.”).\n\n## Android Configuration\n\n1. Open the `settings.gradle` file in your Android Studio.\n\n2. Add maven to the `repositories` section in your `settings.gradle` file:\n\n    ```groovy\n    repositories {\n        maven { url 'https://raw.githubusercontent.com/iProov/android/master/maven/' }\n        maven { url 'https://raw.githubusercontent.com/iProov/kotlin-multiplatform/main/maven/' }\n    }\n    ```\n\n## Kotlin Multiplatform SDK Installation\n\n1. Add the Kotlin Multiplatform SDK version to the `commonMain.dependencies` section in your `build.gradle` file:\n\n    ```kotlin\n    commonMain.dependencies {\n        implementation('com.iproov.kmp:sdk:2.0.0')\n    }\n    ```\n\n2. Build your project\n\n## Get Started\n\nOnce you have a valid token (obtained via the Kotlin Multiplatform API client or your own backend-to-backend call), you can `launch` an iProov capture and handle the state events as they arrive in the `Iproov.sessionState`.\n\n```kotlin\nclass IproovViewModel : ViewModel() {\n\n    init {\n       collectIproovState()\n    }\n\n    private fun startScan(token: String) {\n        viewModelScope.launch {\n            // baseUrl - is the address of the server (SP) you are using\n            // token - the single-use claim token you acquired in the prior step\n            // options - are optional and referenced later in this document (they control the look and feel of the scan's UI among other aspects)\n\n            Iproov.launchSession(baseUrl, token, IproovOptions())\n        }\n    }\n\n    private fun collectIproovState() {\n        viewModelScope.launch {\n            Iproov.sessionState.collect { state -\u003e\n                withContext(Dispatchers.Main) {\n                    when (state) {\n                        is IproovState.Starting -\u003e {\n                            // The SDK is starting (Android Only)\n                        }\n\n                        is IproovState.Connecting -\u003e {\n                            // The SDK is connecting to the server. You should provide an indeterminate progress indicator\n                            // to let the user know that the connection is taking place.\n                        }\n\n                        is IproovState.Connected -\u003e {\n                            // The SDK has connected, and the iProov user interface will now be displayed. You should hide\n                            // any progress indication at this point.\n                        }\n\n                        is IproovState.Processing -\u003e {\n                            // The SDK will update your app with the progress of streaming to the server and authenticating\n                            // the user. This will be called multiple times as the progress updates.\n                            val progress = state.progress // Progress between 0.0 and 1.0\n                            val message = state.message // Message to be displayed to the user\n                        }\n\n                        is IproovState.Success -\u003e {\n                            // The user was successfully verified/enrolled and the token has been validated.\n                            // You can access the following properties:\n                            val frame = state.successResult.frame // An optional image containing a single frame of the user, if enabled for your service provider\n                        }\n\n                        is IproovState.Failure -\u003e {\n                            // The user was not successfully verified/enrolled, as their identity could not be verified,\n                           // or there was another issue with their verification/enrollment. A list of reasons is provided to understand why the claim failed, where each reason contains two properties:\n                           // - feedbackCode: A string representation of the feedback code.\n                           // - description: An informative hint for the user to increase their chances of iProoving successfully next time.\n                            val reasons = state.failureResult.reasons\n                            val frame = state.failureResult.frame // An optional image containing a single frame of the user, if enabled for your service provider\n                        }\n\n                        is IproovState.Error -\u003e {\n                            // The user was not successfully verified/enrolled due to an error (e.g. lost internet connection).\n                            // You will be provided with an Exception (see below).\n                            // It will be called once, or never.\n                            val error = state.exception // IProovException provided by the SDK\n                        }\n\n                        is IproovState.Canceled -\u003e {\n                            // The user canceled iProov, either by pressing the close button at the top of the screen, or sending\n                            // the app to the background. (event.canceler == Canceler.user)\n                            // Or, the app canceled (event.canceler == Canceler.app) by canceling the session to the IProov.cancelSession().\n                            // You should use this to determine the next step in your flow.\n                            val canceler = state.canceler\n                        }\n\n                        null -\u003e {\n                            // First initial value before launch IProov.launchSession() or when cancel the session IProov.cancelSession()\n                        }\n                    }\n                }\n            }\n        }\n    }\n}\n```\n\n👉 You should now familiarize yourself with the following resources:\n\n-  [iProov Face iOS SDK documentation](https://github.com/iProov/ios)\n-  [Android Face Android SDK documentation](https://github.com/iProov/android)\n\nThese repositories provide comprehensive documentation about the available customization options and other important details regarding the SDK usage.\n\n### Canceling the SDK\n\nUnder normal circumstances, the user will be in control of the completion of the iProov scan, i.e. they will either complete the scan, or use the close button to cancel. In some cases, you (the integrator) may wish to cancel the iProov scan programmatically, for example in response to a timeout or change of conditions in your app.\n\nThe scan can now be closed doing `IProov.cancelSession()`.\n\nExample:\n\n```kotlin\nIproov.cancelSession()\n```\n\n## Options\n\nThe `Options` class allows iProov to be customized in various ways. These can be specified by passing the optional `options:` named parameter in `IProov.launchSession()`.\n\nMost of these options are common to both Android and iOS, however, some are Android-only.\n\nFor full documentation, please read the respective [iOS](https://github.com/iProov/ios#options) and [Android](https://github.com/iProov/android#customize-the-user-experience) native SDK documentation.\n\nA summary of the support for the various SDK options in Kotlin Multiplatform is provided below. Any options not set will default to their platform-defined default value.\n\n| Option | Type                                           | iOS | Android |\n|---|------------------------------------------------|---|---|\n| `filter` | `Filter` [(See filter options)](#filter-options) | ✅ | ✅ |\n| `titleTextColor` | `Int`                                          | ✅ | ✅ |\n| `promptTextColor` | `Int`                                          | ✅ | ✅ |\n| `closeButtonTintColor` | `Int`                                          | ✅ | ✅ |\n| `closeButtonImage` | `ByteArray?`                                   | ✅ | ✅ |\n| `title` | `String`                                       | ✅ | ✅ |\n| `fontPath` | `String?`                                      | ✅  | ✅ |\n| `logoImage` | `ByteArray?`                                   | ✅ | ✅ |\n| `promptBackgroundColor` | `Int`                                          | ✅ | ✅ |\n| `promptRoundedCorners` | `Boolean`                                      | ✅ | ✅ |\n| `surroundColor` | `Int`                                          | ✅ | ✅ |\n| `certificates` | `List\u003cCertificate\u003e`                            | ✅ | ✅ |\n| `timeout` | `Int`                                          | ✅ | ✅ |\n| `enableScreenshots` | `Boolean`                                      |  | ✅ |\n| `orientation` | `Orientation`                                  |  | ✅ |\n| `headerBackgroundColor` | `Int`                                          | ✅ | ✅ |\n| `disableExteriorEffects` | `Boolean`                                      | ✅ | ✅ |\n|**`genuinePresenceAssurance`** | `GenuinePresenceAssurance`                     |  |  |\n| ↳ `readyOvalStrokeColor` | `Int`                                          | ✅ | ✅ |\n| ↳ `notReadyOvalStrokeColor` | `Int`                                          | ✅ | ✅ |\n| ↳ `scanningPrompts` | `Boolean`                                      | ✅ | ✅ |\n| ↳ `controlYPosition` | `Boolean`                                      | ✅ | ✅ |\n| ↳ `controlXposition` | `Boolean`                                      | ✅ | ✅ |\n|**`livenessAssurance`** | `LivenessAssurance`                            |  |  |\n| ↳ `ovalStrokeColor` | `Int`                                          | ✅ | ✅ |\n| ↳ `completedOvalStrokeColor` | `Int`                                          | ✅ | ✅ |\n\n### Filter Options\n\nThe SDK supports two different camera filters:\n\n#### `LineDrawingFilter`\n\n`LineDrawingFilter` is iProov's traditional \"canny\" filter, which is available in 3 styles: `.SHADED` (default), `.CLASSIC` and `.VIBRANT`.\n\nThe `foregroundColor` and `backgroundColor` can also be customized.\n\nExample:\n\n```kotlin\nval options = IproovOptions()\n\noptions.filter = IproovOptions.Filter.LineDrawingFilter(\n   style = LineDrawingStyle.VIBRANT,\n   foregroundColor = Color.Black.toArgb(),\n   backgroundColor = Color.White.toArgb()\n)\n```\n\n#### `NaturalFilter`\n\n`NaturalFilter` provides a more direct visualization of the user's face and is available in 2 styles: `.CLEAR` (default) and `.BLUR`.\n\nExample:\n\n```kotlin\nval options = IproovOptions()\n\noptions.filter = IproovOptions.Filter.NaturalFilter(\n   style = NaturalStyle.CLEAR\n)\n```\n\n\u003e **Note**: `NaturalFilter` is available for Liveness Assurance claims only. Attempts to use `NaturalFilter` for Genuine Presence Assurance claims will result in an error.\n\n## Handling errors\n\nAll errors from the native SDKs are re-mapped to Kotlin Multiplatform exceptions:\n\n| Exception                         | iOS | Android | Description                                                                                                                      |\n| --------------------------------- | --- | ------- | -------------------------------------------------------------------------------------------------------------------------------- |\n| `CaptureAlreadyActiveException`   | ✅   | ✅       | An existing iProov capture is already in progress. Wait until the current capture completes before starting a new one.           |\n| `NetworkException`                    | ✅   | ✅       | An error occurred with the video streaming process. Consult the `message` value for more information.                            |\n| `CameraPermissionException`           | ✅   | ✅       | The user disallowed access to the camera when prompted. You should direct the user to re-enable camera access.                   |\n| `ServerException`                 | ✅   | ✅       | A server-side error/token invalidation occurred. The associated `message` will contain further information about the error.      |\n| `UnexpectedErrorException`        | ✅   | ✅       | An unexpected and unrecoverable error has occurred. These errors should be reported to iProov for further investigation.         |\n| `UnsupportedDeviceException`         |✅   | ✅         | Device is not supported.|\n| `ListenerNotRegisteredException`  |     | ✅       | The SDK was launched before a listener was registered.                                                                           |\n| `MultiWindowUnsupportedException` |     | ✅       | The user attempted to iProov in split-screen/multi-screen mode, which is not supported.                                          |\n| `CameraException`                 |     | ✅       | An error occurred acquiring or using the camera. This could happen when a non-phone is used with/without an external/USB camera. |\n| `InvalidOptionsException`         |     | ✅       | An error occurred when trying to apply your options.|\n| `UserTimeoutException`         |✅   |          | The user has taken too long to complete the claim.|\n\n## API Client\n\nThe Kotlin Multiplatform API Client provides a convenient wrapper to call iProov's REST API v2 from your Kotlin Multiplatform app. It is a useful tool to assist with testing, debugging and demos, but should not be used in production mobile apps. You can also use this code as a reference for your back-end implementation to perform server-to-server calls.\n\nThe Kotlin Multiplatform API client package can be found in the `api_client` folder.\n\n\u003e **Warning**\n\u003e\n\u003e Use of the Kotlin Multiplatform API Client requires providing it with your API secret. **You should never embed your API secret within a production app.**\n\n### Registration\n\nYou can obtain API credentials by registering on [iPortal](https://portal.iproov.com).\n\n### Functionality\n\nThe Kotlin Multiplatform API Client supports the following functionality:\n\n- `getToken()` - Get an enrol/verify token.\n\n### Getting a token\n\nThe most basic thing you can do with the API Client is get a token to either enrol or verify a user, using either iProov's Genuine Presence Assurance or Liveness Assurance.\n\nThis is achieved as follows:\n\n```kotlin\nimport com.iproov.kmp.api_client.AssuranceType\nimport com.iproov.kmp.api_client.ClaimType\nimport com.iproov.kmp.api_client.impl.ApiClientImpl\n\nclass IproovViewModel : ViewModel() {\n\n    private val apiClient = ApiClientImpl(\n        baseUrl = Credentials.FUEL_URL,\n        apiKey = Credentials.API_KEY,\n        secret = Credentials.SECRET\n    )\n\n    fun launchIProov() {\n        viewModelScope.launch(Dispatchers.IO) {\n            try {\n                val token = apiClient.getToken(\n                    assuranceType = assuranceType,\n                    claimType = claimType,\n                    userID = username,\n                    resource = null\n                )\n\n                // You can then launch the iProov SDK with this token.\n            } catch (ex: Exception) {\n                ex.printStackTrace()\n            }\n        }\n    }\n}\n```\n\n## Sample code\n\nFor a simple iProov experience that is ready to run out-of-the-box, check out the Kotlin Multiplatform example project which also makes use of the Kotlin Multiplatform API Client.\n\nIn the example app folder, check the `Credentials.kt` file and add your credentials obtained from the [iProov portal](https://portal.iproov.com/).\n\n\u003e NOTE: iProov is not supported on the iOS or Android simulator, you must use a physical device in order to iProov.\n\n### UIStates (optional)\n\nAdditionally, for those wanting to monitor the user experience, there are also UIStates, which indicate when the Session's UI starts and stops.\n\nSimilarly, the Session provides a `val uiState: StateFlow\u003cIProov.UIState\u003e` to be collected from.\n\n## Help \u0026 support\n\nYou may find your question is answered in the documentation of our native SDKs:\n\n- iOS - [Documentation](https://github.com/iProov/ios), [FAQs](https://github.com/iProov/ios/wiki/Frequently-Asked-Questions)\n- Android - [Documentation](https://github.com/iProov/android), [FAQs](https://github.com/iProov/android/wiki/Frequently-Asked-Questions)\n\nFor further help with integrating the SDK, please contact [support@iproov.com](mailto:support@iproov.com).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiproov%2Fkotlin-multiplatform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiproov%2Fkotlin-multiplatform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiproov%2Fkotlin-multiplatform/lists"}