React Native
Logging APIs
The Vision SDK provides logging APIs through the VisionCore
module to send item label and shipping label data to PackageX Vision for analytics, reporting, and data collection purposes. These APIs support both remote and local image URIs with enhanced metadata capabilities.
For complete VisionCore API reference including setEnvironment()
, loadModel()
, and all available methods, see the VisionCore Module Documentation.
🔧 Available Logging Methods
VisionCore.logItemLabelDataToPx
Logs item label data to PackageX Vision with support for optional metadata, enabling enhanced tracking and context for your item scanning workflows.
Method Signature
Parameters
imageUri
(required): Image URI (local file path or remote URL)barcodes
(required): Array of barcode values detected in the imageresponseData
(required): OCR response data objecttoken
(optional): Authentication tokenapiKey
(optional): API keyshouldResizeImage
(optional): Whether to resize image before uploading (default: true)metadata
(optional): Custom metadata object for additional context
Example Usage
VisionCore.logShippingLabelDataToPx
Logs shipping label data to PackageX Vision with support for metadata, recipient, and sender information for comprehensive shipment tracking.
Method Signature
Parameters
imageUri
(required): Image URI (local file path or remote URL)barcodes
(required): Array of barcode/tracking valuesresponseData
(required): OCR response data objecttoken
(optional): Authentication tokenapiKey
(optional): API keylocationId
(optional): Location identifieroptions
(optional): Additional options objectmetadata
(optional): Custom metadata objectrecipient
(optional): Recipient information objectsender
(optional): Sender information objectshouldResizeImage
(optional): Whether to resize image before uploading (default: true)
Example Usage
📱 Complete Example with Error Handling
🔍 Image URI Support
Both logging methods support various image URI formats:
Local File URIs
Remote URIs
📊 Metadata Best Practices
Item Label Metadata
Shipping Label Metadata
🔐 Environment and Authentication
VisionCore logging methods require proper environment setup and authentication:
🔄 Return Values
Unlike the camera-based SDK methods, VisionCore logging methods are async and return promises:
For processing images and receiving structured OCR data, use the headless OCR prediction methods instead. Logging methods are specifically for sending data to PackageX Vision for analytics and reporting purposes.