Skip to main content
Rehydra provides several functions for anonymizing text, from simple one-off calls to reusable instances.

anonymizer.anonymize()

The primary method on an Anonymizer instance.

Signature

Parameters

text
string
required
The text to anonymize
locale
string
Locale hint (e.g., 'de-DE', 'en-US'). Helps with semantic enrichment.
policy
Partial<AnonymizationPolicy>
Policy override for this call. Merged with default policy.

Returns

Example


anonymize()

Standalone function for one-off anonymization (regex-only by default).

Signature

Example

Creates a temporary anonymizer for each call. For multiple texts, use createAnonymizer() instead.

anonymizeRegexOnly()

Fast regex-only anonymization without NER.

Signature

Example

Performance


anonymizeWithNER()

One-off anonymization with NER model.

Signature

Example

Downloads and loads the NER model on each call. For multiple texts, use createAnonymizer() instead.

Policy Overrides

Override default policy for specific calls:

Handling Results

Access Anonymized Text

Check Detection Stats

Validate Output