# react-native-okaycam

> React-Native version of OkayCam

Latest version **3.2.0** (published 2026-11-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-okaycam
pnpm add react-native-okaycam
yarn add react-native-okaycam
bun add react-native-okaycam
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 3.2.0 |
| Published | 2026-11-19 |
| First published | 2021-04-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 119.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Author | innov8tif |
| Maintainers | ekyc.team |
| Keywords | react-native, camera, okaycam, ios-sdk |

## Links

- npm: https://www.npmjs.com/package/react-native-okaycam
- Repository: https://gitlab.com/innov8tif-ekyc-product/okaycam/mobile/react-native-okaycam
- Homepage: https://gitlab.com/innov8tif-ekyc-product/okaycam/mobile/react-native-okaycam#readme
- Issues: https://gitlab.com/innov8tif-ekyc-product/okaycam/mobile/react-native-okaycam/issues
- npm.io page: https://npm.io/package/react-native-okaycam

## Dependencies (1)

- [fs-extra](https://npm.io/package/fs-extra.md) ^11.2.0

## Recent versions

- 3.2.0 (latest) — 2026-11-19
- 2.0.7 (advance) — 2026-06-24
- 1.2.19 (basic) — 2026-06-24
- 3.0.8 — 2026-06-25
- 3.0.7 — 2026-06-19
- 3.0.6 — 2026-05-05
- 3.0.5 — 2026-04-23
- 3.0.4 — 2026-03-27
- 1.2.18 — 2026-03-06
- 3.0.3 — 2026-02-27
- 1.2.17 — 2025-11-18
- 2.0.6 — 2025-11-18
- 3.0.2 — 2025-11-18
- 3.0.1 — 2025-10-15
- 2.0.5 — 2025-10-09
- … 51 more at https://npm.io/package/react-native-okaycam/versions

## README

# react-native-okaycam

## Requirements

### Android

- minSdkVersion >= 30

### iOS

- iOS 15+
- Swift 5

## Getting started

`$ yarn add react-native-okaycam@3.x.x`

### Android

1. Navigate to `android` folder
2. Add following snippet in the root `build.gradle` file:

```
allprojects {
    repositories {
        maven {
            url "https://innov8tif-okaycam.firebaseapp.com"
            content {
                includeGroup "com.innov8tif.xendity"
            }
        }
    }
}
```

3. Sync gradle

### iOS

1. Navigate to ios folder
2. Add the following code to Podfile

```
platform :ios, '15.0'
use_frameworks!

post_install do |installer|
    installer.pods_project.targets.each do |target|
      	if (target.name&.eql?('FBReactNativeSpec'))
            target.build_phases.each do |build_phase|
                if (build_phase.respond_to?(:name) && build_phase.name.eql?('[CP-User] Generate Specs'))
                    target.build_phases.move(build_phase, 0)
          	end
            end
      	end
      	target.build_configurations.each do |config|
        	config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
        	config.build_settings["ONLY_ACTIVE_ARCH"] = "NO"
            if target.name == "CryptoSwift"
                puts "Enable module stability for CryptoSwift"
                config.build_settings['BUILD_LIBRARY_FOR_DISTRIBUTION'] = 'YES'
            end

            if target.name == 'fmt'
                puts "Enable module stability for fmt"
                config.build_settings['CLANG_CXX_LANGUAGE_STANDARD'] = 'c++17'
            end
      	end
    end
end
```

3. Run command `pod install`

4. Add camera permission

#### Android Issue

Duplicate class org.hamcrest.xxx

If you encouter the errors above, you may exclude junit module.

```
configurations { compile.exclude group: "junit", module: "junit" }
```

#### iOS Issue

> Undefined symbol: \__swift_FORCE_LOAD_$\_swiftUniformTypeIdentifiers

> Undefined symbol: \__swift_FORCE_LOAD_$\_swiftCoreMIDI

If you encouter the errors above, you may create a new swift file called **Void.swift** without adding **bridging header**.

<img src="images/image1.png">

## License

Apply licenses for Android and iOS SDKs

```
const license = Platform.select({
    android: "",
    ios: ""
})
```

## OkayCam Document

### Configuration

| -                       | Property name                  | Description                                                                                                                                                                               | Default value |
| ----------------------- | ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- |
|                         | width                          | width to resize the image                                                                                                                                                                 | 2000          |
|                         | imageQuality                   | quality of cropped image                                                                                                                                                                  | 1.0f          |
|                         | **<sup>New</sup>** autoCapture | When set to `true`, the system will automatically capture the document once it is properly detected and aligned. When set to `false`, the user must manually trigger the capture instead. | true          |
| **<sup>New</sup>** mode | FULL                           | Captures front of document, front of document with flash, and back of document automatically. This is the default mode for complete document capture.                                     | ✅            |
|                         | FRONT_ONLY                     | Captures only the front of document.                                                                                                                                                      | ❌            |
|                         | FRONT_BACK                     | Captures both front and back of document automatically without flash.                                                                                                                     | ❌            |
|                         | FRONT_WITH_FLASH               | Captures the front of document with flash enabled                                                                                                                                         | ❌            |

## Usage

```
import { captureDocument, DocumentCaptureMode } from "react-native-okaycam"

  captureDocument(license, false, {
      width: 2000,
      imageQuality: 0.8,
      mode: DocumentCaptureMode.FULL,
    })
      .then(result => {
        console.log(JSON.stringify(result));
      })
      .catch(error => {
        console.log(JSON.stringify(error));
      });
```

### Result

| Result             | Description                    |
| ------------------ | ------------------------------ |
| fullDocumentImage  | Result of first photo          |
| fullDocumentImage2 | Result of first photo cropped  |
| fullDocumentImage3 | Result of second photo         |
| fullDocumentImage4 | Result of second photo cropped |

## OkayCam Selfie

### Configuration

| -                | Property name       | Description                                           | Default value                           |
| ---------------- | ------------------- | ----------------------------------------------------- | --------------------------------------- |
|                  | width               | width to resize the image                             | null                                    |
| -                | imageQuality        | quality of image                                      | 1.0 (range from 0.0 to 1.0)             |
| topLabel         | text                | text of the top label                                 | Please align your face within the frame |
| topLabel         | color               | color of the top label                                | #FFFFFF                                 |
| topLabel         | size                | text size of the top label                            | 24                                      |
| -                | bottomFrameColor    | color of the bottom frame                             | #EB6709                                 |
| switchBtnConfig  | color               | color of the switch button                            | #FFFFFF                                 |
| switchBtnConfig  | show                | show or hide the camera switch button                 | true                                    |
| confirmBtnConfig | backgroundColor     | background color of the confirm button                | #ffa500                                 |
| confirmBtnConfig | contentColor        | content color of the confirm button                   | #ffffff                                 |
| retakeBtnConfig  | backgroundColor     | background color of the retake button                 | #ffa500                                 |
| retakeBtnConfig  | contentColor        | content color of the retake button                    | #ffffff                                 |
| -                | captureBtnColor     | color of the capture button                           | #FFFFFF                                 |
| -                | defaultCameraFacing | initial camera facing when the selfie cam is launched | CameraFacing.FRONT                      |

## Usage

```
import { captureSelfie } from "react-native-okaycam"

captureSelfie(
	license,
	{
		topLabel: {
			text: "Align you face within the frame",
			color: "#4287f5",
			size: 20
		},
		bottomFrameColor: "#4287f5",
		captureBtnColor: "#ffffff",
		switchBtnConfig: {
			color: "#ffffff",
			show: true
		},
        confirmBtnConfig: {
            backgroundColor: "#4287f5",
            contentColor: "#000000"
        },
        retakeBtnConfig: {
            backgroundColor: "#4287f5",
            contentColor: "#000000"
        },
		defaultCameraFacing: "front",
		width: 1000,
        imageQuality: 1.0
	}
)
	.then(result => {
		console.log(result)
	})
	.catch(error => {
		console.log(error)
	})
```

### Result

| Result      | Description           |
| ----------- | --------------------- |
| selfieImage | Captured selfie image |

## Error Codes

| Error                    | Description                                                              |
| ------------------------ | ------------------------------------------------------------------------ |
| invalid license          | The license is invalid                                                   |
| camera permission denied | The use did not grant the permission to access camera in order to do OCR |
| cancel                   | The user canceled during the scanning process                            |

---
_Source: https://npm.io/package/react-native-okaycam · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
