Sign In

@parserelay/angular

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@parserelay/angular

Dead-simple drop-in Angular scanner component for ParseRelay: capture or upload an image, get structured fields back.

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
2
-50%
Maintainers
1
Weekly downloads
 
Created
Source

@parserelay/angular

The Angular twin of @parserelay/scanner: a dead-simple, unstyled standalone component that captures or uploads an image, scans it through the ParseRelay API, and hands you back structured, confidence-scored fields.

import { Component } from "@angular/core";
import { DeadSimpleMicroScanner, type ScanEnvelope } from "@parserelay/angular";

@Component({
  selector: "app-root",
  standalone: true,
  imports: [DeadSimpleMicroScanner],
  template: `
    <parserelay-scanner
      [apiKey]="apiKey"
      [fields]="['merchant', 'total', 'date']"
      docType="receipt"
      (result)="onResult($event)"
      (needsReview)="flagged = $event"
      (error)="onError($event)"
    />
  `,
})
export class AppComponent {
  apiKey = "pk_...";
  flagged: string[] = [];
  onResult(envelope: ScanEnvelope) {
    console.log(envelope.fields, envelope.confidence);
  }
  onError(err: Error) {
    console.error(err);
  }
}

Inputs

InputTypeDefaultNotes
apiKeystring (required)Sent as Authorization: Bearer <apiKey>.
baseUrlstringhosted APIPoint at a self-host / staging deployment.
fieldsstring[]Field-list shorthand → request schema.
docTypeDocTypereceipt | invoice | id | …
engineEngine"auto"auto | ocr | ocr+rescue | vision
modelstringserver defaultPin a specific model.
modelKeystringBring your own key → billed for plumbing only.
capture"environment" | "user" | false"environment"Rear camera on mobile; false for gallery only.

Outputs

OutputPayloadFires when
resultScanEnvelopeA scan completes.
needsReviewstring[]The envelope has low-confidence fields.
errorErrorThe scan fails (transport or API error).

Styling

The component is unstyled. The host element carries data-parserelay-status (idle | reading | scanning | done | error) and the trigger is a plain <button>, so target them from your own stylesheet.

Notes

  • Synchronous path only. The component returns the envelope inline. For fire-and-forget delivery, call the API with a relay config server-side and receive the envelope at your webhook.
  • v0 packaging. Ships TypeScript source compiled by your Angular toolchain (peer @angular/core / @angular/common >=17). An ng-packagr build for standalone npm consumption is a follow-up; today it's consumed from source.

FAQs

Package last updated on 15 Jun 2026

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