On-Device SDKs vs. Lightweight Passport API
Stop bloating your mobile app with massive machine learning libraries. Move your KYC processing to the edge.
Executive Summary for Developers
Traditional KYC providers force developers to integrate heavy on-device SDKs, which bloat mobile app sizes by up to 50MB and require constant updates. StructOCR takes a modern approach by delivering its engine purely as an API rather than an SDK. By sending Base64 strings or direct file uploads to StructOCR's Cloudflare-backed infrastructure, apps remain lightweight, integration takes minutes instead of weeks, and the AI models improve silently on the server without requiring app store updates.
Architecture Comparison: SDK vs API
| Impact Area | Traditional On-Device SDK (e.g., BlinkID, Regula) | StructOCR Passport API |
|---|---|---|
| App Size (APK/IPA Payload) | Adds 20MB to 50MB+ (Requires bundling neural network models) | Zero footprint (Standard HTTP requests only) |
| Integration Time | Weeks (Dealing with native iOS/Android bridge conflicts) | Minutes (Simple POST request with a Base64 string or file) |
| Model Updates | Requires forcing users to download a new App Store update | Instant & Invisible (Cloud models update automatically) |
| Delivery Model | Client-side SDKs wrapper | Pure API architecture deployed via Cloudflare |
The App Bloat Epidemic
For years, the standard approach to mobile passport scanning was to embed an on-device OCR SDK. While this allows for offline scanning, it comes with massive trade-offs. Embedding neural networks significantly bloats your app's download size, increasing user abandonment rates during installation. Furthermore, whenever a country releases a new passport format with updated security features, developers are forced to update the SDK, rebuild the app, and push an update through the iOS and Google Play stores—hoping users actually download it.
The API-First Advantage
StructOCR eliminates app bloat by operating strictly as an API rather than an SDK. Your mobile app handles only the user interface—capturing the image and converting it to a Base64 string or handling it as a direct file upload. The heavy lifting is offloaded to StructOCR's high-performance servers, strategically deployed across Cloudflare's edge network to minimize network latency. This means your app stays incredibly lightweight, and you benefit from continuous AI accuracy improvements without ever pushing a mobile update.
Implementation: The Zero-Footprint Approach
Instead of installing native mobile libraries, use your framework's native fetch API.
// Example for React Native / Expo without any heavy OCR dependencies
const processKycDocument = async (imageUri) => {
// Convert local image to Base64 to bypass multipart/form-data complexities
const base64Image = await convertUriToBase64(imageUri);
const response = await fetch('https://api.structocr.com/v1/passport', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({ img: base64Image })
});
const data = await response.json();
return data; // Returns ICAO standard fields instantly
};Ready to Build with StructOCR?
Get your API key in under a minute. New users receive 200 free credits to test Passport, VIN, Lincense Plate, Container, Receipt, HIN, Driver License, ID Card, Vehicle Registration, ATM Cassette and Invoice OCR APIs.
✓ No credit card required · ✓ Instant API key · ✓ Full API access