Node/TypeScript SDK for the DeepXL API: fraud detection, document parsing, and ID verification.
Installation
npm install deepxl-node-sdk
Example
Create an API key in the DeepXL Dashboard (Settings → API Keys).
Treat your API key like any environment secret. Do not commit to a public repository or store in plain text.
import { DeepXLClient } from "deepxl-node-sdk";
const client = new DeepXLClient({ apiKey: process.env.DEEPXL_API_KEY });
const detection = await client.detectFile("document", "./file.pdf");
const parsed = await client.parseFile("light", "./id.pdf");
const verification = await client.verifyFiles("./id.jpg", "./selfie.jpg");
console.log(detection.likelihood, parsed.documentType, verification.verified);
Client methods
Account
- checkUsage() – GET /v1/account. Returns
UsageResponse (usage and limits per media type). Optional fields: parsingUsageLimit, parsingUsage.
Models
- getDetectionModels() – GET /v1/detection-models. Returns
ModelMetadata[].
- getParsingModels() – GET /v1/parsing-models. Returns
ModelMetadata[].
Fraud detection
- detect(modelName, fileName, fileData [, tags]) / detectFile(modelName, filePath [, tags]) – POST /v1/detection. Models:
document, object. Returns result object (e.g. detectionId, likelihood, reasoning, modelResults, files).
- getDetection(detectionId) – GET /v1/detection/. Returns single detection result.
- listDetections([params]) – GET /v1/detection. Params:
limit, offset, sortBy, direction, tagFilter. Returns { totalCount, count, data }.
Document parsing
- parse(modelName, fileName, fileData [, tags]) / parseFile(modelName, filePath [, tags]) – POST /v1/parse. Models:
light, performance. Returns result object (e.g. parseId, documentType, parsedData, files).
- getParse(parseId) – GET /v1/parse/. Returns single parse result.
- listParses([params]) – GET /v1/parse. Params: same as list. Returns
{ totalCount, count, data }.
ID verification
- verify(idFileName, idFileData, selfieFileName, selfieFileData [, tags]) / verifyFiles(idFilePath, selfieFilePath [, tags]) – POST /v1/verification. Returns result object (e.g.
verificationId, verified, modelResults, files).
- getVerification(verificationId) – GET /v1/verification/. Returns single verification result.
- listVerifications([params]) – GET /v1/verification. Returns
{ totalCount, count, data }.
File retrieval
- getFile(fileName) – GET /v1/files/. Returns
Buffer. Use the file name from the files array in any analysis response.
Types
- UsageResponse –
imageUsageLimit, imageUsage, videoUsageLimit, videoUsage, audioUsageLimit, audioUsage, documentUsageLimit, documentUsage, and optionally parsingUsageLimit, parsingUsage.
- ModelMetadata –
name, description, tags, category, validInputTypes, validFileTypes, ownedBy, version.
- ListParams –
limit, offset, sortBy, direction, tagFilter.
Errors
The client throws AuthError, FileTypeError, InvalidParameterError, UsageLimitError, or ServerError from deepxl-node-sdk for API errors.