Initialize the module
Callinit once before using another operation.
Operations
redact, mask, and remove
strategies.
JavaScript-native ranges
Findings containutf16Range. Transformation records contain
sourceUtf16Range and outputUtf16Range. These zero-based, end-exclusive
ranges work directly with String.prototype.slice.
Unsupported provider operations
Browser/WASM does not accept key or token providers. It returnsunsupported_strategy when pseudonymization or tokenization is selected and
for every restoration call.
This is an intentional security boundary, not a missing fallback. Provider
credentials and key custody require a separately designed host integration.
Errors
The JavaScript wrapper throwsDataFogError with the same stable fields as the
Node.js binding. See Errors.
Structured JSON and PERSON fields
UsediscoverFields(data, config?), scanStructured(data, config?),
transformStructured(data, findings, config), and
scanAndTransformStructured(data, config). Scan returns { mappings, findings };
transformation returns { data, transformations }. Located findings contain
path and finding; located records contain path and transformation.
Call await init() first. Selected provider-backed strategies and
restoreStructured reject with unsupported_strategy.
Paths are JSON Pointers. All ranges, including JavaScript UTF-16 ranges,
address the decoded string at that path. See person-field discovery
for aliases, policy configuration, input limits, and examples.