Skip to content

Type Alias: DebugOption ​

DebugOption = true | ((event) => void)

Defined in: src/types/options.ts:186

Controls structured debug logging of request lifecycle events.

  • true — logs a plain summary of each event via console.debug('[valifetch]', summary): type, method, url, request headers, plus attempt/status/responseHeaders (response) or attempt/delay/reason (retry). Values of headers, and of URL query parameters, whose name matches auth, cookie, token, secret, key, session, pass, credential, sig, jwt, dpop, csrf, xsrf, otp, bearer or code (case-insensitive substring) are replaced with '[REDACTED]'. Matching is deliberately broad, so some harmless names are redacted too. The URL path and fragment are logged as-is.
  • function — receives each DebugEvent directly, with the live Request/Response (headers unredacted); redacting secrets is then the function's responsibility

Released under the MIT License. Built with Claude Code.