You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

expo-mlkit-ocr

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expo-mlkit-ocr

React Native module for text recognition using Google's ML Kit

2.0.1
latest
Source
npmnpm
Version published
Weekly downloads
149
-21.99%
Maintainers
1
Weekly downloads
 
Created
Source

Expo ML Kit OCR

Text recognition for React Native using native OCR engines.

  • Android: Google ML Kit
  • iOS: Apple Vision Framework

Installation

npm install expo-mlkit-ocr

Requires expo-modules-core.

Usage

import ExpoMlkitOcr from 'expo-mlkit-ocr';

const result = await ExpoMlkitOcr.recognizeText('file:///path/to/image.jpg');
console.log(result.text);

// Log each block
result.blocks.forEach((block, blockIndex) => {
  console.log(`Block ${blockIndex}:`, block.text);
  
  // Log each line in the block
  block.lines.forEach((line, lineIndex) => {
    console.log(`  Line ${lineIndex}:`, line.text);
    
    // Log each element in the line
    line.elements.forEach((element, elementIndex) => {
      console.log(`    Element ${elementIndex}:`, element.text);
    });
  });
});

API

recognizeText(imageUri: string)

Returns:

{
  text: string;
  blocks: Array<{
    text: string;
    lines: Array<{
      text: string;
      elements: Array<{
        text: string;
        cornerPoints: Array<{x: number, y: number}>;
      }>;
      cornerPoints: Array<{x: number, y: number}>;
    }>;
    cornerPoints: Array<{x: number, y: number}>;
  }>;
}

Requirements

  • iOS 13.0+
  • Android API 21+

License

MIT

Keywords

react-native

FAQs

Package last updated on 24 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.