Governance
Audit, field history and data lifecycle, the blocks behind records of who changed what and how long it is kept.
Covers accountability: the audit log, per-field change history and retention with legal holds. The plan called it compliance; see the names.
better-supabase add governanceexport default defineConfig({ blocks: { governance: {} } });add lists governance in blocks, writes the modules of every part and wires the client in lib/blocks.ts. Import the manifest from better-supabase/blocks/governance when you build the set with createBlocks.
import { governanceBlock } from "better-supabase/blocks/governance";Parts
Installing governance installs these blocks. Each stays an ordinary block in the config and keeps its own client.
Helpers
exportSubject: Request a subject data export, then record it in the audit log under a key derived from the export id, so a retry never writes a second entry.
await blocks.governance.exportSubject({ subjectType: "contact", subjectId });The helper returns a Result; each step is idempotent, so retrying after a partial failure is safe.
Remove
better-supabase remove governance
better-supabase remove governance --with-partsThe first command replaces governance in blocks with its parts. The second removes the parts too, except any part another block still needs (remove).
Last updated on