Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

Handle errors and timeouts

Reject failed responses

Pass the literal throwOnError: true to reject unsuccessful HTTP responses and retain a non-optional success type.
import { egovPay } from "egov.js"; try { const transaction = await egovPay.getTransaction({ client, path: { uuid: transactionUuid }, throwOnError: true, }); console.log(transaction.data); } catch (error) { logger.warn("eGov request failed"); throw error; }
HTTP failures throw the parsed JSON body or response text. Network and abort failures propagate as native errors. Treat every caught value as unknown until your application has validated it.
Provider error bodies can contain citizen data, payment details, phone numbers, tokens, or diagnostics. Do not log them unless the fields have been explicitly validated and redacted.

Set a deadline

import { egovPay } from "egov.js"; await egovPay.getTransaction({ client, path: { uuid: transactionUuid }, signal: AbortSignal.timeout(10_000), throwOnError: true, });

Retry deliberately

The generated Fetch client does not retry automatically. Payment, messaging, complaint, blockchain, and biometric operations can have external side effects. Retry only when the endpoint is idempotent or the provider supports a stable idempotency key.