AWS Textract

Async Textract client and converter for S3-backed documents.

import {
  AwsTextractAnalyzeOptionsSchema,
  AWS_TEXTRACT_ANALYZE_OUTPUT_CAPABILITIES,
  createAwsTextractClient,
  mapAwsTextractToParsedDocument,
  resolveAwsTextractFeatureTypes,
  textractClientRequestToken,
} from '@openparser/adapters/aws-textract';

Client

const client = createAwsTextractClient({ region: 'us-east-1' });
const { canonical } = await client.parse({
  documentId: 'doc-1',
  jobId: 'job-abc-123',
  featureTypes: ['LAYOUT', 'FORMS', 'SIGNATURES', 'QUERIES'],
  queries: ['What is the invoice total?'],
  source: { bucket: 'my-bucket', objectKey: 'sources/.../source' },
});

The client starts async Textract jobs against an existing S3 object and polls with pagination. Omit region to use the AWS SDK default credential chain. File bytes are not accepted — Textract async requires S3.

Factory options: region, timeoutMs, pollIntervalMs, maxPollIntervalMs, maxResultPages, sleep, client.

Use resolveAwsTextractFeatureTypes to merge base FeatureTypes with forms/signatures/queries options. Omit FeatureTypes for DetectDocumentText.

Adapter-only

Call mapAwsTextractToParsedDocument when you already have paginated Textract block results.

On this page