Text to scan.
Optionaltypes?: DetectionType[]Which types to look for. Default is 'email', 'phone', and 'creditCard'. 'apiKey', 'ip', and 'jwt' are opt-in only, given their higher false-positive risk (or, for 'jwt', simply being a bearer secret rather than classic PII).
Every match found, in the order it appears in the text.
Scans free-form text for the same embedded PII (emails, phone numbers, credit card numbers, public IPv4 addresses) and secrets (API keys/tokens, JWTs) that
redactdetects, but returns each match as structured data instead of masking it in place — for callers that want to inspect, log, or make their own decision about what was found, rather than have it masked automatically.Reuses exactly the same detection logic
redactdoes, so it carries the same known gaps and false-positive/negative characteristics — seeredact's own documentation for the specifics on'ip'and'jwt'.scanis best-effort pattern matching, not a complete PII/secret detector.