npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-vision-camera-mlkit

v1.0.0

Published

A powerful React Native Vision Camera plugin delivering high-performance Google ML Kit frame processor features—including text recognition (OCR), face detection, barcode scanning, pose detection, and more. Seamlessly bridges native ML Kit capabilities for

Readme

react-native-vision-camera-mlkit

Contributors Forks Stargazers Issues MIT License NPM Version

A React Native Vision Camera plugin that exposes high-performance Google ML Kit frame processor features such as text recognition (OCR), face detection, barcode scanning, pose detection, and more.

The example app is intentionally heavy and demo-focused. For integration details, follow the documentation below.

Requirements

Install Vision Camera (React Native):

npm i react-native-vision-camera
cd ios && pod install

Install Worklets Core:

npm i react-native-worklets-core
# or
yarn add react-native-worklets-core

Add the Babel plugin in babel.config.js:

module.exports = {
  plugins: [['react-native-worklets-core/plugin']],
};

For Expo, follow the Vision Camera guide: react-native-vision-camera.com/docs/guides

Installation

npm install react-native-vision-camera-mlkit
# or
yarn add react-native-vision-camera-mlkit

cd ios && pod install

ML Kit Models Installation (Selective)

By default, all ML Kit features are enabled. You can selectively include only the models you need to reduce binary size.

Android (Gradle)

In your app's android/build.gradle (root project), add:

ext["react-native-vision-camera-mlkit"] = [
  mlkit: [
    textRecognition: true,
    textRecognitionChinese: false,
    textRecognitionDevanagari: false,
    textRecognitionJapanese: false,
    textRecognitionKorean: false,
    faceDetection: false,
    faceMeshDetection: false,
    poseDetection: false,
    poseDetectionAccurate: false,
    selfieSegmentation: false,
    subjectSegmentation: false,
    documentScanner: false,
    barcodeScanning: true,
    imageLabeling: false,
    objectDetection: false,
    digitalInkRecognition: false,
  ]
]

iOS (Podfile)

In your ios/Podfile, add a configuration hash before target:

$VisionCameraMLKit = {
  'textRecognition' => true,
  'textRecognitionChinese' => false,
  'textRecognitionDevanagari' => false,
  'textRecognitionJapanese' => false,
  'textRecognitionKorean' => false,
  'faceDetection' => false,
  'poseDetection' => false,
  'poseDetectionAccurate' => false,
  'selfieSegmentation' => false,
  'barcodeScanning' => true,
  'imageLabeling' => false,
  'objectDetection' => false,
  'digitalInkRecognition' => false,
}

Android-only keys: faceMeshDetection, subjectSegmentation, documentScanner.

Usage

Text Recognition (Frame Processor)

import {
  useFrameProcessor,
  runAsync,
  runAtTargetFps,
} from 'react-native-vision-camera';
import { useTextRecognition } from 'react-native-vision-camera-mlkit';

const { textRecognition } = useTextRecognition({
  language: 'LATIN',
  scaleFactor: 1,
  invertColors: false,
});

const frameProcessor = useFrameProcessor(
  (frame) => {
    'worklet';

    runAtTargetFps(10, () => {
      'worklet';
      runAsync(frame, () => {
        'worklet';
        const result = textRecognition(frame, {
          outputOrientation: 'portrait',
        });
        console.log(result.text);
      });
    });
  },
  [textRecognition]
);

TextRecognitionOptions:

  • language?: 'LATIN' | 'CHINESE' | 'DEVANAGARI' | 'JAPANESE' | 'KOREAN'
  • scaleFactor?: number (0.9-1.0)
  • invertColors?: boolean
  • frameProcessInterval?: number (deprecated, use runAtTargetFps)

TextRecognitionArguments:

  • outputOrientation?: 'portrait' | 'portrait-upside-down' | 'landscape-left' | 'landscape-right' (iOS only)

Image Processing (Static Images)

Use processImageTextRecognition to analyze a file path or URI without the camera (for example, images picked from the gallery).

import { processImageTextRecognition } from 'react-native-vision-camera-mlkit';

const result = await processImageTextRecognition(imageUri, {
  language: 'LATIN',
  orientation: 'portrait',
  invertColors: false,
});

console.log(result.blocks);

TextRecognitionImageOptions:

  • language?: 'LATIN' | 'CHINESE' | 'DEVANAGARI' | 'JAPANESE' | 'KOREAN'
  • orientation?: 'portrait' | 'portrait-upside-down' | 'landscape-left' | 'landscape-right'
  • invertColors?: boolean

The native bridge normalizes URIs (file:// is removed on iOS and added on Android if missing). Supported formats: JPEG, PNG, WebP.

Feature Utilities

The package also exposes helpers from the plugin factory:

import {
  getFeatureErrorMessage,
  isFeatureAvailable,
  assertFeatureAvailable,
  getAvailableFeatures,
} from 'react-native-vision-camera-mlkit';
  • getAvailableFeatures(): MLKitFeature[]
  • isFeatureAvailable(feature: MLKitFeature): boolean
  • assertFeatureAvailable(feature: MLKitFeature): void
  • getFeatureErrorMessage(feature: MLKitFeature): string

Error Handling

Frame processors throw a setup error when the feature is not enabled in Gradle/Podfile. For static image processing, the following error strings are exported:

  • IMAGE_NOT_FOUND_ERROR
  • INVALID_URI_ERROR
  • IMAGE_PROCESSING_FAILED_ERROR
  • UNSUPPORTED_IMAGE_FORMAT_ERROR

Use the feature helpers to provide user-friendly configuration hints:

import {
  assertFeatureAvailable,
  MLKIT_FEATURE_KEYS,
} from 'react-native-vision-camera-mlkit';

assertFeatureAvailable(MLKIT_FEATURE_KEYS.TEXT_RECOGNITION);

Performance

  • Follow the Vision Camera performance guide
  • Prefer runAsync(...) for heavy ML work to keep the frame processor responsive.
  • Use runAtTargetFps(...) to throttle processing instead of frameProcessInterval.

iOS Orientation Notes (Text Recognition)

iOS camera sensors are fixed in landscape orientation. The frame buffer stays landscape-shaped even when the UI rotates, so ML Kit needs an explicit orientation hint to rotate text correctly. On iOS, pass outputOrientation to textRecognition(frame, { outputOrientation }) so ML Kit can map the buffer to upright text. Android handles rotation automatically.

⚠️ iOS Simulator (Apple Silicon) – Heads-up

On Apple Silicon Macs, building for the iOS Simulator (arm64) may fail after installing this package.

This is a known limitation of Google ML Kit, which does not currently ship an arm64-simulator slice for some iOS frameworks. The library works correctly on physical iOS devices and on the iOS Simulator when running under Rosetta.

Google ML Kit Vision Features Roadmap

| # | Feature | Status | Platform | | --- | --------------------------------- | ------------------------------------------ | ------------------------------------------------- | | 0 | Text recognition v2 | complete | android ios | | 1 | Face detection | in-progress | android ios | | 2 | Face mesh detection | in-progress | android | | 3 | Pose detection | in-progress | android ios | | 4 | Selfie segmentation | in-progress | android ios | | 5 | Subject segmentation | in-progress | android | | 6 | Document scanner | in-progress | android | | 7 | Barcode scanning | in-progress | android ios | | 8 | Image labeling | in-progress | android ios | | 9 | Object detection and tracking | in-progress | android ios | | 10 | Digital ink recognition | in-progress | android ios |

Sponsor on GitHub

If this project helps you, please consider sponsoring its development

react-native-vision-camera-mlkit is provided as is and maintained in my free time.

If you’re integrating this library into a production app, consider funding the project.