---
title: "Passport OCR Extraction Adapter"
slug: passport-ocr-extraction-adapter
section: Portals
status: stable
description: "The custom passport extraction adapter is created using the `createPassportExtractionAdapter` factory function [4]."
last-updated: 2026-10-07
---

# Passport OCR Extraction Adapter

> **Auto-generated**
>
> Drafted by the docs-update-agent from [PPPToo#389](https://github.com/Alliance-Strategies/PPPToo/pull/389) ([1218694169667926] Restore pre-#373 OCR extraction adapter -- engine never fires the repaired one). Every statement cites a source file; review welcome.

The custom passport extraction adapter is created using the `createPassportExtractionAdapter` factory function [4]. The adapter factory receives a context object from the form engine [1].

## Adapter Factory Contract

The context object from the form engine contains only `form` and `setExtractingByField` [1]. This simplified contract is necessary because the form engine does not provide the richer context objects that a previous adapter version required [2]. Using an adapter that required a richer context would cause a synchronous error [2].

## Provenance Tracking

The provenance tracking system is designed to handle untagged 'echo' events from the form engine [3]. This prevents a field's origin from being incorrectly reverted after an OCR write [3].

## Sources

- PPPToo#389 - [1218694169667926] Restore pre-#373 OCR extraction adapter -- engine never fires the repaired one

## References

[1]: https://github.com/Alliance-Strategies/PPPToo/blob/development/client/src/hooks/usePassportCapture.ts "client/src/hooks/usePassportCapture.ts"
[2]: https://github.com/Alliance-Strategies/PPPToo/blob/development/client/src/hooks/usePassportCapture.ts "client/src/hooks/usePassportCapture.ts"
[3]: https://github.com/Alliance-Strategies/PPPToo/blob/development/client/src/lib/passportProvenance.ts "client/src/lib/passportProvenance.ts"
[4]: https://github.com/Alliance-Strategies/PPPToo/blob/development/client/src/hooks/usePassportCapture.ts "client/src/hooks/usePassportCapture.ts"
