Skip to main content

Redact | Node.js SDK

The Pangea Redact API helps developers limit the sprawl of sensitive information by performing redaction using defined rules.

Redact

redact(text: string, options: TextOptions): Promise<PangeaResponse<BaseResponse>>

Redact sensitive information from provided text

required parameters

string

The text data to redact

Supported options:

  • debug {Boolean} - Setting this value to true will provide a detailed analysis of the redacted data and the rules that caused redaction
  • rules {String[]} - An array of redact rule short names

Response Object

const response = await redact.redact("Jenny Jenny... 415-867-5309");

Redact structured

redactStructured(data: object, options: StructuredOptions): Promise<PangeaResponse<StructuredResponse>>

Redact sensitive information from structured data (e.g., JSON)

required parameters

object

Structured data to redact

Supported options:

  • debug {Boolean} - Setting this value to true will provide a detailed analysis of the redacted data and the rules that caused redaction
  • rules {String[]} - An array of redact rule short names
  • jsonp {String[]} - JSON path(s) used to identify the specific JSON fields to redact in the structured data. Note: If jsonp parameter is used, the data parameter must be in JSON format.
  • format {String} - The format of the structured data to redact. Default: "json"

Response Object

const data = { "phone": "415-867-5309" };

const response = await redact.redactStructured(data);

Interface BaseResponse

interface BaseResponse

required parameters

number
string

Interface Options

interface Options

optional parameters

boolean
Array<string>

Interface StructuredOptions

interface StructuredOptions

optional parameters

boolean
string
Array<string>
Array<string>

Interface StructuredParams

interface StructuredParams

required parameters

Object

optional parameters

boolean
string
Array<string>
Array<string>

Interface StructuredResponse

interface StructuredResponse

required parameters

number
object

Interface TextOptions

interface TextOptions

optional parameters

boolean
Array<string>

Interface TextParams

interface TextParams

required parameters

string

optional parameters

boolean
Array<string>