
Security News
Opengrep Adds Apex Support and New Rule Controls in Latest Updates
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
react-native-ocr-package
Advanced tools
A React component for scanning National Identity cards using a device's camera. This package integrates OCR technology to extract the text data from scanned cards by making API calls.
A React component for scanning National Identity cards using a device's camera. This package integrates OCR technology to extract the text data from scanned cards by making API calls.
Install the package via npm:
npm install react-native-ocr-package
Additionally, install the required dependency:
npm install react-native-document-scanner-plugin
Here is how to use the component in your React application:
import React, {useState} from 'react';
import { View } from 'react-native';
import {CameraComponent} from 'react-native-ocr-package';
const App = () => {
const handleOCRResult = ocrResult => {
console.log('OCR Result:', ocrResult);
};
return (
<View style={{flex: 1}}>
<CameraComponent
ocrApiUrl="https://your-api-endpoint.com/"
onScanComplete={handleOCRResult}
/>
</View>
);
};
export default App;
The CameraComponent
accepts the following props:
Prop Name | Type | Required | Description |
---|---|---|---|
ocrApiUrl | string | Yes | The API endpoint to call for OCR processing of the scanned image. |
onScanComplete | func | Yes | Callback function invoked with the scanned OCR result. |
Here is an example of the JSON output returned by the API when the scan is successful:
{
"Code": 200,
"Message": "Success",
"Data": {
"OCR": {
"Code": 100,
"Message": "Success",
"CNIC_MATCHED": true,
"DOI": "10.06.2014",
"DOB": "12.03.2000",
"DOE": "10.06.2024",
"CNum": "12345-1234567-1",
"Name": "ABC",
"FName": "XYZ"
},
"Image_Comparison": {
"Code": 100,
"Message": "Selfie and CNIC Matched",
"confidence_score": 100.0
}
}
}
FAQs
A React component for scanning National Identity cards using a device's camera. This package integrates OCR technology to extract the text data from scanned cards by making API calls.
The npm package react-native-ocr-package receives a total of 0 weekly downloads. As such, react-native-ocr-package popularity was classified as not popular.
We found that react-native-ocr-package demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.