@smileid/kamera
v0.1.0
Published
Smile ID's purpose-built camera SDK for React Native. Thin wrapper embedding the native kamera cores — pixels never cross the bridge.
Keywords
Readme
kamera-react-native
The React Native SDK for kamera — a thin, faithful wrapper that embeds the native kamera cores (kamera-android, kamera-ios). It replaces react-native-vision-camera used by the production Smile ID RN SDK today.
What this is
- An RN library (
@smileid/kamera) targeting the New Architecture: a Fabric native component (KameraPreviewView) for preview and a TurboModule (NativeKamera) for the control plane — configuration, lifecycle, capture, zoom/torch/focus — with analysis results and session state as direct events. - Pixels never cross the bridge. Frame analysis (ML Kit / Vision through the frozen
Analyzerpattern) runs natively; JS receives events and capture file paths. No frame-processor worklets in v1 — raw pixel access in JS is explicitly out of scope until a product case demands it. - A real still-capture pipeline for RN. The production RN SDK today captures by grabbing an analysis frame; kamera gives RN the same ZSL / MaxQuality / Ultra-HDR capture path as native Android and iOS.
Goals
- Behavioral parity with the native SDKs: same
KameraConfigfields, same defaults, same events, same capture result schema (../SPEC.md§3–4). - Low-end performance by construction: preview is a native view, analysis is native, JS thread stays idle apart from lightweight events.
- Serve as the ML staging ground for RN:
sample/renders native analysis events live so ML experiments validate here before the production RN SDK.
Layout
src/ TS API — KameraPreviewView (Fabric), NativeKamera (TurboModule spec), types
sample/ Sample app — preview, analysis event overlay, captureML backend toggle
The Android glue defaults to the ML Kit adapter; switch with one flag
(docs/design/20 D4): -PkameraMlBackend=huawei (or KAMERA_ML_BACKEND=huawei) puts
com.usesmileid:kamera-huawei on the host classpath and injects the HMS repo —
none adds no adapter. iOS pairs with Vision (KameraVision); HMS ML is
Android-only, a documented platform divergence.
Local development
Wire the glue to locally built cores — Android via publishToMavenLocal, iOS via
locally built xcframeworks. Walkthrough: ../docs/local-dev.md.
Why this package still has a podspec
Stable RN autolinking is podspec-driven; SPM autolinking is an RFC/prototype
(react-native-community/discussions-and-proposals #994). kamera-rn.podspec is the
minimum CocoaPods surface — it ships inside the npm package (never published to the
CocoaPods trunk, so the Dec 2026 trunk read-only date doesn't affect it) and vendors
the same xcframeworks the SPM-only Flutter glue uses. Drop it when RN ships SPM
autolinking in stable. Details: docs/design/18.
Requirements
React Native ≥ 0.76 (New Architecture) · minSdk 24 · iOS 15.0 (matches the production Smile ID RN SDK floors)
Status
Bootstrapping — TS API stubs and codegen specs in place. See ../SPEC.md §6.4 and milestones §9.
