filecheck-node wraps the REST API in a typed client for Node.js 18+, with zero runtime dependencies. Its centerpiece is jobs.verify() — the whole server-side verification checklist in one call.
Verify a job before fulfilling
The Element gives the customer ajobId; never trust it blind. Verify it with your secret key before fulfilling:
verify() confirms the job is terminal, proceedable (the Element’s canProceed equivalent, with the Workflow’s on-fail policy applied), and — when you pass workflowId — that it ran the expected Workflow. It returns { ok, state, reason, job }, so the full job (including download URLs on deliverables) is already in hand when it passes.
Upload and process files
For headless flows with no browser involved:{ wait?, waitTimeoutMs? } instead of the API’s raw sync/async flags, with defaults matching each endpoint (validate and optimize wait by default; the rest are async). If the server’s ~27-second window elapses, the SDK keeps polling GET /jobs/{id} for you and resolves { job, pending }.
Surface
Client options:
new Filecheck('sk_…', { baseUrl?, timeoutMs?, maxRetries?, fetch? }). Passing a publishable pk_… key throws immediately with an explanation, and keys are never echoed in full.
Webhooks
express.raw, await request.text()). Webhook signature verification is not yet live; { verify: false } is the explicit, temporary opt-in for unsigned payloads, and the helper is designed so verification becomes the default without a breaking change once the signing scheme ships.
Errors and retries
Typed errors —AuthenticationError (401/403), InvalidRequestError (400), NotFoundError (404), RateLimitError (429), APIError (5xx), ConnectionError — carry status and the parsed body. Branch on the error class, not the message text.
Idempotent GETs are retried automatically (exponential backoff with jitter, Retry-After honored). POSTs are never auto-retried: the API has no idempotency keys, and a duplicated POST /jobs creates and bills a second job. If you need retry-safe creates, tag sources with metaData and reconcile via jobs.list().