Keep secrets and PII out of logs, Sentry, LLM prompts and commits. Reads values, not field names. Zero dependencies.
https://flare-collection.github.io/flare-redact/ β// momentum
// why it's here
- Active: last commit today
- Health 92/100 with only 56 stars
// how to help
// readme
It reads the values, not the field names. Zero dependencies.
Β· Guide Β· API Β· Recipes Β· Docs for AI assistants
Someone logs an object, a session token was inside it, and now that token sits
in your log aggregator, your error tracker and an LLM providerβs servers.
Redaction by field name only hides the fields you remembered to list.
flare-redact looks at the values themselves, so the AWS key pasted into a
note field and the card number inside a stack trace are masked too.
import { redact } from 'flare-redact';
redact('User alice@corp.com paid with 4242 4242 4242 4242, token ghp_' + 'a'.repeat(36));
// β 'User a***@*** paid with **** **** **** 4242, token ghp_***'
redact({ user: 'bob@corp.com', password: 'hunter2', note: 'my key is AKIAIOSFODNN7EXAMPLE' });
// β { user: 'b***@***', password: '***', note: 'my key is AKIA***' }