
Barcode Capture Rn
Wire Scandit BarcodeCapture into a React Native scan screen with camera lifecycle, symbologies, and navigation focus handling.
Overview
barcode-capture-rn is an agent skill for the Build phase that integrates Scandit BarcodeCapture into React Native scan screens.
Install
npx skills add https://github.com/scandit/skills --skill barcode-capture-rnWhat is this skill?
- React Native function component baseline with hooks and `@react-navigation/native` focus handling
- Scandit v8 APIs: `DataCaptureContext`, `Camera`, `DataCaptureView`, `BarcodeCapture` pipeline
- Configurable symbologies via `BarcodeCaptureSettings` and `Symbology` enums
- Overlay and session types (`BarcodeCaptureOverlay`, `BarcodeCaptureSession`) for scan UI
- Documented extension points: custom feedback, viewfinder, duplicate filter, lifecycle cleanup
- Baseline targets Scandit React Native Data Capture v8 API
- Eval group references 6+ additive features (feedback, viewfinder, duplicate filter, lifecycle, etc.)
Adoption & trust: 1 installs on skills.sh; 12 GitHub stars; 2/2 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
What problem does it solve?
You have a React Native app placeholder for scanning but no working camera pipeline, symbology config, or lifecycle-safe BarcodeCapture setup.
Who is it for?
Indie mobile apps (inventory, events, field tools) that need reliable on-device barcode reading with Scandit RN SDK v8.
Skip if: Web-only scanners, fully custom ML models without Scandit, or greenfield apps with no React Native stack.
When should I use this skill?
You are implementing or extending a React Native screen that must scan barcodes with Scandit BarcodeCapture.
What do I get? / Deliverables
You get a hook-based `ScanScreen` wired to Scandit’s capture context, camera, overlay, and session callbacks ready to extend with product-specific scan behavior.
- Integrated `ScanScreen` component
- BarcodeCapture settings and overlay wiring
- Focus-aware camera start/stop behavior
Recommended Skills
Journey fit
Barcode scanning is product implementation work that belongs in Build when you integrate a commercial mobile SDK. integrations captures third-party SDK setup (license key, DataCaptureContext, BarcodeCapture modules) rather than generic UI polish alone.
How it compares
Mobile SDK integration skill—not a generic Expo camera tutorial or server-side barcode API.
Common Questions / FAQ
Who is barcode-capture-rn for?
Solo builders shipping React Native apps who licensed Scandit and need agent-guided integration on a primary scan screen.
When should I use barcode-capture-rn?
During Build integrations while replacing a ‘Scanner goes here’ placeholder with BarcodeCapture, camera lifecycle, and symbology settings.
Is barcode-capture-rn safe to install?
It touches camera and commercial SDK credentials; review the Security Audits panel on this page and never commit real license keys to git.
SKILL.md
READMESKILL.md - Barcode Capture Rn
// Entry point component for the React Native app. The BarcodeCapture // integration should go here as a function component with hooks. // Assume this file is the screen rendered by the navigator / App root. import React from 'react'; import { View, Text } from 'react-native'; export const ScanScreen = () => { // TODO: integrate BarcodeCapture here. return ( <View style={{ flex: 1 }}> <Text>Scanner goes here</Text> </View> ); }; // Basic BarcodeCapture integration already in place (React Native, v8 API, // function component with hooks). Evals in this group add features on top of // this baseline (custom feedback, viewfinder, location selection, scan // intention, codeDuplicateFilter, lifecycle cleanup, etc.). import React, { useCallback, useEffect, useRef, useState } from 'react'; import { View, Text, StyleSheet } from 'react-native'; import { useFocusEffect } from '@react-navigation/native'; import { Camera, DataCaptureContext, DataCaptureView, FrameSourceState, } from 'scandit-react-native-datacapture-core'; import { BarcodeCapture, BarcodeCaptureOverlay, BarcodeCaptureSession, BarcodeCaptureSettings, Symbology, SymbologyDescription, } from 'scandit-react-native-datacapture-barcode'; const licenseKey = '-- ENTER YOUR SCANDIT LICENSE KEY HERE --'; DataCaptureContext.initialize(licenseKey); const dataCaptureContext = DataCaptureContext.sharedInstance; export const ScanScreen = () => { const [lastScan, setLastScan] = useState<string | null>(null); const viewRef = useRef<DataCaptureView | null>(null); const cameraRef = useRef<Camera | null>(null); const barcodeCaptureRef = useRef<BarcodeCapture | null>(null); if (cameraRef.current === null) { const camera = Camera.default; camera?.applySettings(BarcodeCapture.recommendedCameraSettings); dataCaptureContext.setFrameSource(camera); cameraRef.current = camera; } if (barcodeCaptureRef.current === null) { const settings = new BarcodeCaptureSettings(); settings.enableSymbologies([ Symbology.EAN13UPCA, Symbology.Code128, Symbology.QR, ]); const barcodeCapture = new BarcodeCapture(settings); dataCaptureContext.addMode(barcodeCapture); barcodeCaptureRef.current = barcodeCapture; } useEffect(() => { const barcodeCapture = barcodeCaptureRef.current!; const listener = { didScan: async ( mode: BarcodeCapture, session: BarcodeCaptureSession, ) => { const barcode = session.newlyRecognizedBarcode; if (barcode == null) return; mode.isEnabled = false; const symbology = new SymbologyDescription(barcode.symbology); setLastScan(`${barcode.data} (${symbology.readableName})`); mode.isEnabled = true; }, }; barcodeCapture.addListener(listener); const overlay = new BarcodeCaptureOverlay(barcodeCapture); viewRef.current?.addOverlay(overlay); return () => { // No teardown of the mode yet — evals may add removeMode here. }; }, []); useFocusEffect( useCallback(() => { const barcodeCapture = barcodeCaptureRef.current!; const camera = cameraRef.current; barcodeCapture.isEnabled = true; camera?.switchToDesiredState(FrameSourceState.On); return () => { barcodeCapture.isEnabled = false; camera?.switchToDesiredState(FrameSourceState.Off); }; }, []), ); return ( <View style={styles.container}> <DataCaptureView style={styles.preview} context={dataCaptureContext} ref={view => { viewRef.current = view; }} /> <View style={styles.results}> <Text>{lastScan ?? 'Waiting for scan...'}</Text> </View> </View> ); }; const styles = StyleSheet.create({ container: { flex: 1 }, preview: { flex: 1 }, results: { padding: 16, backgroundColor: '#fff' }, }); { "name": "my-rn-barcode-capture-app", "version": "1.0.0", "description": "React Nat