Skip to content
saleban olow edited this page Apr 24, 2025 · 1 revision

Frequently Asked Questions

This page answers common questions about Purgo.

General Questions

What is Purgo?

Purgo is a zero-config, client-side log-scrubbing library that prevents Protected Health Information (PHI) from leaking into browser consoles, DevTools, and network debuggers.

Is Purgo free to use?

Yes, Purgo is open-source software released under the MIT License, which allows for free use, modification, and distribution.

Does Purgo work with my framework?

Purgo is designed to work with all major JavaScript frameworks, including React, Next.js, Vue, Angular, and vanilla JavaScript. It also provides Node.js support.

How much does Purgo impact performance?

Purgo is designed to be lightweight and fast, with less than 3% runtime overhead compared to raw operations. The bundle size is less than 7 kB gzipped.

Technical Questions

How does Purgo work?

Purgo works by patching global objects like console methods, fetch, and XMLHttpRequest to intercept and redact sensitive information before it's logged or sent over the network.

Does Purgo modify the actual data being sent to the server?

No, Purgo only redacts data in logs and network request debugging information. The actual data sent to the server remains unchanged.

Can I use Purgo with TypeScript?

Yes, Purgo includes full TypeScript declarations for all modules, providing a great developer experience with TypeScript.

Does Purgo work in both development and production environments?

Yes, Purgo works in both development and production environments. However, you might want to configure it differently in each environment based on your needs.

How do I add custom patterns for redaction?

You can add custom patterns using regular expressions:

import { purgo } from 'purgo';

purgo({
  patterns: [
    'email',                        // Built-in pattern
    /\bMRN-\d{8}\b/g,               // Custom pattern for Medical Record Numbers
    /\b[A-Z]{2}-\d{6}-[A-Z]\b/g,    // Custom pattern for patient IDs
  ]
});

Can I customize how redacted content appears?

Yes, you can customize the redaction style using the censor option:

import { purgo } from 'purgo';

purgo({
  censor: (match) => '[REDACTED]' + match.slice(-2)
});

Does Purgo work with third-party logging services?

Purgo works with any service that uses the standard console methods or network requests. For specific integrations like Pino, Purgo provides dedicated adapters.

HIPAA Compliance Questions

Is Purgo HIPAA-compliant?

Purgo is a tool that helps with HIPAA compliance by preventing accidental PHI exposure in logs and network requests. However, using Purgo alone does not guarantee HIPAA compliance, which requires a comprehensive approach to security and privacy.

Do I need a BAA to use Purgo?

If you're using Purgo in a production environment that processes real PHI, you may need a Business Associate Agreement (BAA) with the provider of Purgo. A ready-to-sign BAA template is available in the legal directory of the Purgo repository.

What types of PHI does Purgo protect?

Purgo includes built-in patterns for detecting and redacting common types of PHI:

  • Email addresses
  • Social Security Numbers (SSNs)
  • Phone numbers
  • Medical Record Numbers (MRNs)
  • ICD-10 diagnosis codes

You can also add custom patterns for organization-specific identifiers.

Can Purgo help with GDPR compliance?

While Purgo is primarily designed for HIPAA compliance, its ability to redact sensitive information can also help with GDPR compliance by preventing accidental exposure of personal data.

Troubleshooting

Purgo isn't redacting sensitive information in my application. What should I check?

  1. Make sure you're importing Purgo at the entry point of your application
  2. Check that you're using the latest version of Purgo
  3. For Next.js, ensure you're importing in the correct layout file
  4. For Node.js, make sure you're using the purgo/node import
  5. Verify that your sensitive data matches the built-in patterns or add custom patterns

I'm getting errors when importing Purgo. What should I do?

  1. Make sure you're using the correct import statement for your environment
  2. Check for compatibility issues with your framework or bundler
  3. Try using the core module (purgo/core) if you're having issues with the auto-patching functionality

How do I report a bug or request a feature?

You can report bugs or request features by opening an issue on GitHub.

Contributing

How can I contribute to Purgo?

Contributions are welcome! Please see the Contributing Guide for details on how to contribute to Purgo.

I found a security vulnerability. How do I report it?

If you discover a security vulnerability, please send an email to [your-email@example.com] instead of opening a public issue.