Install
@origoid/sdk.
Source on github.com/origoid/sdk-node
(public, for auditing).
Initialize the client
process.env, a secrets
manager (Vault, 1Password, Doppler, etc.), or your platform’s config
layer.
Your first call
The example below usesPELJ900101HDFRRN09, a synthetic CURP from
the OpenAPI examples — not a real person’s CURP. Replace it with the
CURP you need to validate.
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
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, includingINVALID_REQUEST, the SDK returns a
normal Envelope object. Inspect status and type before using
data:
Transport errors — caught with try/catch
For401, 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 theOrigoidApi
namespace: