React Native
AI Scanning APIs
The Vision SDK supports OCR via cloud-based APIs to extract structured data from various documents like shipping labels, BOLs (Bill of Lading), and item labels. This mode leverages RESTful APIs and requires a valid API key and environment to be configured before making any calls.
π SDK Configuration for Cloud OCR
Before initiating an OCR scan, you must set the following props:
mode ocrMode ocrType onOCRScan onImageCaptured apiKey environment
π You can obtain your API key and environment details from cloud.packagex.io.
π§Ύ Document Types Supported
The Vision SDK cloud OCR supports the following document types:
π¦ Shipping Labels
Extracts structured data such as tracking numbers, courier names, addresses, etc. More details Here
Hereβs an explanation of each parameter in the callScanAPIWith method used to scan Shipping Labels via the Vision SDK's Cloud OCR API:
π¦ Example Component with requried props for Shipping Label
π Bills of Lading (BOL)
Detects and extracts BOL-specific fields such as carrier information, consignee details, and reference numbers. More details Here
π Example Component with requried props for Bill of Lading (BOL)
π·οΈ Item Labels
Recognizes SKU, GTIN, price, brand, and other item-level information printed on labels. More details Here
π·οΈ Example Component with requried props for Item Labels
Camera Guidelines (Image Sharpness Score)
When the camera is operating in OCR or Photo mode, you receive continuous feedback on the sharpness score of each frame.
The sharpness score is a floating-point value ranging from 0.0 to 1.0, where:
1.0indicates a perfectly sharp image suitable for OCR processing.0.0indicates a completely blurry image.
Use this score to provide live feedback to users or decide whether to proceed with image capture.
Event
Example Usage
Below is a sample React Native component demonstrating how to listen for sharpness score updates and capture images with their corresponding sharpness values.