Compare sanitization presets side-by-side
{
"user": {
"name": "John Doe",
"email": "john.doe@example.com",
"password": "super_secret_123",
"ssn": "123-45-6789",
"phone": "+1 (555) 123-4567"
},
"payment": {
"cardNumber": "4111-1111-1111-1111",
"cvv": "123",
"expiryDate": "12/25",
"billingAddress": "123 Main St, New York, NY 10001"
},
"medical": {
"patientId": "PAT-2024-001",
"diagnosis": "Common cold",
"medications": [
"Acetaminophen",
"Vitamin C"
],
"insuranceId": "INS-987654321"
},
"api": {
"apiKey": "sk_live_abc123xyz789",
"secretToken": "ghp_xxxxxxxxxxxxxxxxxxxx",
"bearerToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.test"
}
}No sanitization - shows raw data (not recommended for production)
{
"user": {
"name": "John Doe",
"email": "john.doe@example.com",
"password": "super_secret_123",
"ssn": "123-45-6789",
"phone": "+1 (555) 123-4567"
},
"payment": {
"cardNumber": "4111-1111-1111-1111",
"cvv": "123",
"expiryDate": "12/25",
"billingAddress": "123 Main St, New York, NY 10001"
},
"medical": {
"patientId": "PAT-2024-001",
"diagnosis": "Common cold",
"medications": [
"Acetaminophen",
"Vitamin C"
],
"insuranceId": "INS-987654321"
},
"api": {
"apiKey": "sk_live_abc123xyz789",
"secretToken": "ghp_xxxxxxxxxxxxxxxxxxxx",
"bearerToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.test"
}
}Basic sanitization - passwords and secrets only
{
"user": {
"name": "John Doe",
"email": "john.doe@example.com",
"password": "[REDACTED]",
"ssn": "123-45-6789",
"phone": "+1 (555) 123-4567"
},
"payment": {
"cardNumber": "4111-1111-1111-1111",
"cvv": "123",
"expiryDate": "12/25",
"billingAddress": "123 Main St, New York, NY 10001"
},
"medical": {
"patientId": "PAT-2024-001",
"diagnosis": "Common cold",
"medications": [
"Acetaminophen",
"Vitamin C"
],
"insuranceId": "INS-987654321"
},
"api": {
"apiKey": "[REDACTED]",
"secretToken": "ghp_xxxxxxxxxxxxxxxxxxxx",
"bearerToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.test"
}
}Standard sanitization - common PII fields and patterns
{
"user": {
"name": "John Doe",
"email": "jo***@example.com",
"password": "[REDACTED]",
"ssn": "[REDACTED]",
"phone": "+1 (555) 123-4567"
},
"payment": {
"cardNumber": "****1111",
"cvv": "[REDACTED]",
"expiryDate": "12/25",
"billingAddress": "123 Main St, New York, NY 10001"
},
"medical": {
"patientId": "PAT-2024-001",
"diagnosis": "Common cold",
"medications": [
"Acetaminophen",
"Vitamin C"
],
"insuranceId": "INS-987654321"
},
"api": {
"apiKey": "[REDACTED]",
"secretToken": "ghp_xxxxxxxxxxxxxxxxxxxx",
"bearerToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.test"
}
}GDPR compliant - EU personal data protection requirements
{
"user": {
"name": "[REDACTED]",
"email": "[REDACTED]",
"password": "[REDACTED]",
"ssn": "[REDACTED]",
"phone": "[REDACTED]"
},
"payment": {
"cardNumber": "****1111",
"cvv": "[REDACTED]",
"expiryDate": "12/25",
"billingAddress": "123 Main St, New York, NY 10001"
},
"medical": {
"patientId": "PAT-2024-001",
"diagnosis": "Common cold",
"medications": [
"Acetaminophen",
"Vitamin C"
],
"insuranceId": "INS-987654321"
},
"api": {
"apiKey": "[REDACTED]",
"secretToken": "ghp_xxxxxxxxxxxxxxxxxxxx",
"bearerToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.test"
}
}HIPAA compliant - Healthcare data protection (US)
{
"user": {
"name": "[REDACTED]",
"email": "[REDACTED]",
"password": "[REDACTED]",
"ssn": "[REDACTED]",
"phone": "[REDACTED]"
},
"payment": {
"cardNumber": "****1111",
"cvv": "[REDACTED]",
"expiryDate": "12/25",
"billingAddress": "123 Main St, New York, NY 10001"
},
"medical": {
"patientId": "[REDACTED]",
"diagnosis": "[REDACTED]",
"medications": [
"Acetaminophen",
"Vitamin C"
],
"insuranceId": "INS-[SSN_REDACTED]"
},
"api": {
"apiKey": "[REDACTED]",
"secretToken": "ghp_xxxxxxxxxxxxxxxxxxxx",
"bearerToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.test"
}
}PCI-DSS compliant - Payment card industry standards
{
"user": {
"name": "John Doe",
"email": "john.doe@example.com",
"password": "[REDACTED]",
"ssn": "[REDACTED]",
"phone": "+1 (555) 123-4567"
},
"payment": {
"cardNumber": "[REDACTED]",
"cvv": "[REDACTED]",
"expiryDate": "12/25",
"billingAddress": "123 Main St, New York, NY 10001"
},
"medical": {
"patientId": "PAT-2024-001",
"diagnosis": "Common cold",
"medications": [
"Acetaminophen",
"Vitamin C"
],
"insuranceId": "INS-987654321"
},
"api": {
"apiKey": "[REDACTED]",
"secretToken": "ghp_xxxxxxxxxxxxxxxxxxxx",
"bearerToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.test"
}
}import { createLogger, sanitize } from 'vestig'
// Using preset in logger config
const log = createLogger({
sanitize: 'gdpr', // or 'hipaa', 'pci-dss', 'default', 'minimal'
})
// All logs automatically sanitized
log.info('User login', {
email: 'john@example.com', // → [EMAIL REDACTED]
password: 'secret123', // → [REDACTED]
creditCard: '4111-1111-1111', // → [CARD REDACTED]
})
// Direct sanitization
const cleanData = sanitize(userData, { preset: 'hipaa' })