# react-native-text-recognition

> text recognition utilizing the Vision framework on iOS and Firebase ML on Android

Latest version **1.0.2** (published 2024-06-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-text-recognition
pnpm add react-native-text-recognition
yarn add react-native-text-recognition
bun add react-native-text-recognition
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2024-06-27 |
| First published | 2021-08-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 530.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 32 |
| Author | Joey Eamigh |
| Keywords | react-native, ios, android |

## Links

- npm: https://www.npmjs.com/package/react-native-text-recognition
- Repository: https://github.com/JoeyEamigh/react-native-text-recognition
- Homepage: https://github.com/JoeyEamigh/react-native-text-recognition#readme
- Issues: https://github.com/JoeyEamigh/react-native-text-recognition/issues
- npm.io page: https://npm.io/package/react-native-text-recognition

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2024-06-27
- 2.0.0-alpha.1 (v2-exp) — 2024-06-27
- 1.1.1 (ml) — 2024-06-27
- 1.1.0 — 2021-08-20
- 1.0.1 — 2021-08-11
- 1.0.0 — 2021-08-10

## README

# React-Native-Text-Recognition

Very basic text recognition utilizing the Vision framework on iOS and Firebase ML on Android

I also have a version that utilizes Firebase ML on both iOS and Android. You can check that out or install it on the [ml-only](https://github.com/JoeyEamigh/react-native-text-recognition/tree/ml-only) branch!

## NOTE:

I do not do much React Native anymore, so this project is largely unmaintained. If someone wants to join as a contributor, I would be happy have a conversation!

## Installation

```sh
yarn add react-native-text-recognition
```

or with NPM:

```sh
npm install react-native-text-recognition
```

<hr>

### iOS:

<b>Make sure that your Podfile's minimum deployment target is 13.0 or greater!!</b>

If you get an error about "Could not find or use auto-linked library 'xxxxx'" then add the following to your project's Build Settings under LIBRARY_SEARCH_PATHS:

```
"$(SDKROOT)/usr/lib/swift"
```

This error is most common on XCode 12+

<hr>

## Usage

```js
import TextRecognition from 'react-native-text-recognition';

// pass the image's path to recognize

const result = await TextRecognition.recognize('/var/mobile/...');
```

### Configuration and Options

There is an optional configuration object affecting iOS vision only. It includes one key, `visionIgnoreThreshold` which is a number (<= 1).

```ts
type TextRecognitionOptions = {
  visionIgnoreThreshold?: number;
};
```

It is used at the end of the `recognize` function:

```js
const result = await TextRecognition.recognize('/var/mobile/...', {
  visionIgnoreThreshold: 0.5,
});
```

The only thing that this changes is whether or not to return a recognized string based on the Vision Framework's "confidence." You can read more at [https://developer.apple.com/documentation/vision/vnobservation/2867220-confidence/](https://developer.apple.com/documentation/vision/vnobservation/2867220-confidence/)

## Contributing

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License

MIT

---
_Source: https://npm.io/package/react-native-text-recognition · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
