TypeScript SDK
Use the TypeScript SDK to check drafts and read saved reports from your own code. You need Node.js 22 or newer and an authorized readlint.com account.
Install
npm install readlint.com
Authenticate
Create an API key and supply READLINT_API_KEY through your environment or secret manager. The SDK accepts an explicit key before the environment variable. It does not read the CLI's saved login. Do not commit keys or print them.
For interactive device login, use the CLI, which saves its own credential. Scripts using the SDK should receive a separate API key from your secret manager. Both keys act for the same account. Listing reports does not require evaluation allowance.
First success
Choose the TypeScript tab. The other tabs use the CLI, other SDK or curl setup.
List saved reports
npx readlint.com list --limit 25 --offset 0 --jsonimport json
from readlint import Readlint
with Readlint() as client:
print(json.dumps(client.list_evaluations(limit=25, offset=0)))import { Readlint } from "readlint.com";
const client = new Readlint();
console.log(JSON.stringify(await client.listEvaluations({ limit: 25, offset: 0 })));curl --silent --show-error --fail-with-body \
--header @readlint-auth.header \
'https://readlint.com/v1/evaluations?limit=25&offset=0'A valid key returns items and next_offset. An empty account returns {"items": [], "next_offset": null}. Follow evaluate an article for submission, reading and deletion examples in every client.
Responses and configuration
Save the TypeScript example as list_reports.mjs and run node list_reports.mjs. It uses JavaScript syntax that also compiles in a TypeScript project. Keep account keys on your server, outside public browser bundles.
The package exports Readlint, ReadlintError and response types including Evaluation, EvaluationPage and EvaluationReport. Results use the API's JSON field names. Dates are strings and report is nullable.
new Readlint({ apiKey, baseUrl, timeoutMs, maxRetries, fetch }) accepts overrides. apiKey and baseUrl override READLINT_API_KEY and READLINT_BASE_URL. The defaults are https://readlint.com, 120000 milliseconds and 2 retries. fetch supplies a test transport. Redirects are refused.
ReadlintError exposes code, message, status (null for transport errors) and evaluationId. Invalid local options throw TypeError. createDeviceCode({ hostname, os }) and createDeviceToken(deviceCode) expose the device protocol. Callers must respect its polling interval and keep the returned key private.
Retry safely
evaluate requires an explicit submission key (idempotency_key in Python, idempotencyKey in TypeScript). Save it before sending. After a timeout, use the same key and identical article, title and description. A running evaluation has report: null; read its ID later. A stored failed evaluation raises evaluation_failed; reading its ID returns the saved failure.
Reads and keyed submissions retry network failures and HTTP 429, 502, 503 and 504 at most twice. They honor Retry-After; waits over 60 seconds stop the call. Deletes are sent once. Read the same ID after a lost delete response before trying again. The limits and recovery guide explains account errors, expiry and terminal failures.