How gdp-admin/glair-vision-node-sdk works
GLAIR Vision is a Node.js client SDK for sending OCR, face-biometric, identity, and session requests to the GLAIR Vision API. The principal workflow is an application calling a Vision capability with an image or session parameters, the SDK preparing and validating the request, and the API returning a result. OCR covers many document types; face workflows include matching and liveness. The README documents identity and additional session capabilities, but their implementations were not sampled, so their internal request wiring is not expanded here.
Main entry points: ocr.ts Document OCR · faceBio.ts Face biometrics · ktpSessions.ts KTP sessions · npwpSessions.ts NPWP sessions
Components 20
SDK entry
- Vision SDK
src/api/vision.ts
Vision capabilities
- Document OCR
src/api/ocr.ts - Face biometrics
src/api/faceBio.ts - Identity
src/api/identity.ts - KTP sessions
src/api/sessions/ktpSessions.ts - NPWP sessions
src/api/sessions/npwpSessions.ts - Passive liveness sessions
src/api/sessions/passiveLivenessSessions.ts - Active liveness sessions
src/api/sessions/activeLivenessSessions.ts
Request support
- Settings
src/api/config.ts - Image conversion
src/util/image.ts - Input validation
src/util/validator.ts - API transport
src/util/visionFetch.ts - Logging
src/util/logger.ts
Data contracts
- Session contracts
src/types/session.ts - OCR result contracts
src/types/common.ts
Other components
- Application
- GLAIR Vision API
- OCR results
- Biometric results
- Session results
Connections 41
- Application → Vision SDK: uses
- Vision SDK → Document OCR: exposes
- Vision SDK → Face biometrics: exposes
- Vision SDK → Identity: exposes
- Document OCR → KTP sessions: exposes
- Document OCR → NPWP sessions: exposes
- Face biometrics → Passive liveness sessions: exposes
- Face biometrics → Active liveness sessions: exposes
- Document OCR → Image conversion: converts images
- Face biometrics → Image conversion: converts images
- Document OCR → Input validation: validates input
- KTP sessions → Input validation: validates parameters
- NPWP sessions → Input validation: validates parameters
- KTP sessions → Session contracts: uses contracts
- NPWP sessions → Session contracts: uses contracts
- Document OCR → Settings: gets settings
- Face biometrics → Settings: gets settings
- KTP sessions → Settings: gets settings
- NPWP sessions → Settings: gets settings
- Passive liveness sessions → Settings: gets settings
- Active liveness sessions → Settings: gets settings
- Document OCR → API transport: sends requests
- Face biometrics → API transport: sends requests
- KTP sessions → API transport: sends requests
- NPWP sessions → API transport: sends requests
- Passive liveness sessions → API transport: sends requests
- Active liveness sessions → API transport: sends requests
- API transport → GLAIR Vision API: calls API
- Document OCR → OCR results: returns OCR data
- Face biometrics → Biometric results: returns biometric data
- KTP sessions → Session results: returns session data
- NPWP sessions → Session results: returns session data
- Passive liveness sessions → Session results: returns session data
- Active liveness sessions → Session results: returns session data
- OCR result contracts → Document OCR: types results
- Document OCR → Logging: logs activity
- Face biometrics → Logging: logs activity
- KTP sessions → Logging: logs activity
- NPWP sessions → Logging: logs activity
- Passive liveness sessions → Logging: logs activity
- Active liveness sessions → Logging: logs activity