Client Examples
Ready-to-use clients for the DocBen CF4 Validation API. Both are dependency-free
(Node 18+) and read the API key from the DOCBEN_API_KEY environment variable —
never hardcode your key. See the integration guide for full docs.
JavaScript
docbenClient.js
Minimal CommonJS client: getQuota, uploadAttachment, submitValidation, waitForResult. No dependencies.
TypeScript
docbenClient.ts
Fully-typed client with interfaces for quota, attachments, results, and errors. Compiles under tsc --strict.
Project setup
package.json
Scripts + devDependencies (@types/node, ts-node, typescript) to run either client.
tsconfig.json
Strict TypeScript config targeting Node 16+ module resolution.
Sample data
sample-cf4.json
A complete, valid CF4 claim used by both clients (placeholder data — no real PII).
Quick start (JavaScript):
export DOCBEN_API_KEY="your-key" && node docbenClient.js