All blocks
Brick
Available
Free

Privacy, retention, feature flags and currency

Version
0.1.2
Database part
No

The contract

Small rules every app needs, kept in one place.

Settings

NameWhat it does
retentionRulesHow long each kind of record is kept, in years and days. Defaults to the Australian starting points in defaultRetentionRules.
piiKeysField names whose values are hidden in logs, as well as the defaults. Pass them as extraKeys.
whenMissingWhether a feature that has no flag is on. Defaults to false.
localeThe locale amounts are shown in. Defaults to en-AU.
currencyThe currency amounts are in. Defaults to AUD.
currencySymbolsThe symbol shown for each currency code. Defaults to defaultCurrencySymbols, such as A$ for AUD.

Requires

This block works on its own.

Live demo

Hide personal data before it reaches a log

What the log would hold

{
  "id": 4021,
  "name": "Sam Lee",
  "email": "[redacted]",
  "phone": "[redacted]",
  "date_of_birth": "[redacted]",
  "tfn": "[redacted]",
  "membership_no": "[redacted]",
  "api_token": "[redacted]",
  "note": "Rang from 0412 345 678 about the receipt. Card 4242 4242 4242 4242.",
  "plan": "monthly"
}

Free text is hidden by pattern too. The note reads Rang from 0412 345 678 about the receipt. Card [redacted-card].

An email address
s***@example.org
A phone number
***678
A token
tok_li***(21)

When a record may be purged

The starting points are Australian, and an app can set its own.

The record is due to be purged.

Due on 30 June 2026.

Feature flags

A person always lands on the same side of a rollout, so a feature never flickers on and off.

FlagSet up asFor this person
new-dashboard50 in 100 peopleOff (bucket 98)
beta-reportsNamed people and the admin roleOff
everyone-featureOn for everyoneOn
switched-offOff for everyoneOff

A misspelt flag, new-dashbord, is off. By default a typo never turns a feature on.

Money in whole minor units

What a person types is read, turned into whole cents without rounding, and shown with a symbol that names the currency.

Read as
5000.50
Held as
500,050
Shown in a table
A$5,000.50
Shown to a donor
A$5,000.50