Skip to main content
The Node SDK ships with full TypeScript definitions, automatic retries, and one strongly-typed method per OrigoID endpoint. It works in any Node 18+ runtime and in Deno.

Install

Package on npm: @origoid/sdk. Source on github.com/origoid/sdk-node (public, for auditing).

Initialize the client

That’s the whole setup — there is nothing else to configure. Never hardcode the API key in source. Load it from process.env, a secrets manager (Vault, 1Password, Doppler, etc.), or your platform’s config layer.

Your first call

The example below uses PELJ900101HDFRRN09, a synthetic CURP from the OpenAPI examples — not a real person’s CURP. Replace it with the CURP you need to validate.
Every method returns the same Envelope shape: { status, type, message, data, transactionId, processedAt, billable, errors? }. See Response envelope for the full contract.

Methods by resource

The client groups operations under one property per regulatory domain.

client.authentication

client.renapo

client.sat

client.imss

client.ine

client.compliance

Note: the method for the SAT 69-B list is searchSat69B (capital B). The other compliance methods follow the regular camelCase pattern.

client.biometrics

client.email

client.proofOfAddress

Error handling

The SDK distinguishes between business errors (returned inside the envelope) and transport errors (thrown as typed exceptions).

Business errors — read from the envelope

For any HTTP 200, including INVALID_REQUEST, the SDK returns a normal Envelope object. Inspect status and type before using data:

Transport errors — caught with try/catch

For 401, 429, and unrecoverable transport failures the SDK throws typed errors:

Per-call configuration (advanced)

Every method accepts an optional second argument:
Read this before tuning timeouts or retries. The SDK only sends a retry for 5xx and network failures, never for successful business responses — so retries do not create duplicate billable calls when the API responded correctly. They do create extra calls when the request actually failed: a request that times out three times can consume three credits if the request eventually succeeded on a later attempt.
  • Defaults (timeoutInSeconds: 60, maxRetries: 2) are right for almost every workload. Change them only with a specific reason.
  • Combining a long timeout with high maxRetries (e.g. 120s × 5) means a single failing request can occupy a client thread for up to 10 minutes — bad for your own throughput and infrastructure.
  • Set per-call overrides only on endpoints with known slow cold starts (some compliance and INE-list calls).

TypeScript

Every request and response type is exported under the OrigoidApi namespace:

CommonJS

The package ships both ESM and CJS entry points. In a CommonJS project:

Browser usage

Do not call OrigoID directly from a browser. API keys are long-lived credentials that grant billable access to your account; the moment a key reaches a browser bundle, browser console, or local storage, it is effectively public and at risk of abuse — the same way you would never put a credit-card processor’s secret key in client-side code. The correct pattern is backend-for-frontend (BFF): your browser talks to your server, your server holds the API key and calls OrigoID from a trusted environment (Node, Python, Go). If your use case truly requires browser-direct calls (partner widget, embedded form, etc.) we can enable CORS for your specific origins. The key stays out of the browser only if you scope it carefully and pair it with referrer/origin restrictions — we will help you design that flow. Reach out and we will work through the architecture with you.