Skip to main content
Extend Rehydra with custom recognizers for domain-specific identifiers like order numbers, employee IDs, or proprietary formats.

Quick Start

Custom ID Recognizer

For simple pattern-based detection, use createCustomIdRecognizer:
Always include the g (global) flag in your regex patterns. Without it, only the first match will be found.

Available PII Types for Custom Patterns

Extending RegexRecognizer

For more control, extend the RegexRecognizer class:

Built-in Recognizers

Rehydra includes these recognizers by default:

Secrets Recognizers (opt-in)

These are registered automatically when secrets: { enabled: true } is set: See the Secrets Detection guide for full configuration options.

Recognizer Registry

Manage recognizers through the registry:

Create a New Registry

For complete control, create a custom registry:

Disabling Built-in Recognizers

To disable specific built-in recognizers:

Pattern Best Practices

Prevent matching substrings:
Avoid overly broad patterns:
Validate matches for accuracy:
Complex patterns can slow detection:

Testing Recognizers

Next Steps

PII Types

All supported PII types

API Reference

Complete API documentation