Pre-built code blocks

User data a buyer will accept

Acquisition-ready user-data schema (consent + metrics + export)

For when the answer to “I might sell this business one day” is yes.

Structures user data so it is a SELLABLE asset, not a liability — the retention/conversion metrics a buyer's due diligence asks for, AND the consent-to-transfer + deletion layer that makes the data legally sellable at all.

A filing drawer of upright cards resting on the pan of a balance scale, closed by a ribbon with a round wax seal, and a small open bin standing beside it

Skip the rebuild

You do not write this one. It arrives in your project as ordinary source you can read, change and keep, with its audit record and its caveats beside it.

  1. Download the Playground. It is free and runs on your own machine.
  2. Start a new app and tick “I might sell this business one day”.
  3. This block is written in, along with anything else you ticked.

Download the Playground See the other blocks

The mistake it removes

The half that's usually missing is the expensive one: without a record that each user consented to their data transferring on acquisition, the user base can't legally be included in a sale — and dirty, non-deletable data gets a deal discounted or killed. This block ships that half. It also ships the Supabase Row Level Security most schemas forget — without it, the auto-generated API lets any logged-in user read everyone's data.

What is already handled

Each of these was checked by running the code, not by reading it.

What the audit found

Named rather than summarized. The reasoning behind each one ships inside the block, so it travels with the code instead of living on a page you have to trust.

What you still have to do

A copied file cannot own your secrets, your host or your legal obligations. This is the part the block deliberately does not claim.

What lands in your project

sql

  • sql/core.sql
  • sql/acquisition.sql
  • sql/value_tables.vibecoder.sql
  • sql/value_tables.authorge.sql
  • sql/rls.supabase.sql

Postgres/Supabase migrations, applied IN ORDER: (1) core.sql — users, consent, daily usage; (1b) acquisition.sql — the revenue layer (subscriptions/products + MRR/margin/concentration views) the Acquisition Standard reads; then — users, consent, profiles, daily usage, deletion, retained-cohort view; (2) ONE value-tables file for your domain (vibecoder = projects/deployments; authorge = manuscripts/publications); (3) rls.supabase.sql LAST if on Supabase — enables Row Level Security so the auto-generated API can't leak every user's data. On raw Postgres with no auth.uid(), skip step 3 and enforce ownership in your own server code.

node

  • node/data-asset.js

createDataAsset({ query }) returns { recordConsent, hasTransferConsent, transferableCounts, exportUserData, deleteUser }. DB-agnostic — pass a query(text, params) fn (pg pool.query shape).

What you supply

Licensed MIT. It is a starting point, not a finished product.

Get it

Download the Playground See the other blocks

Nothing here is locked. The files are yours, in your folder, under a permissive license.

Questions

Is User data a buyer will accept audited?
It was audited on 2026-07-18, and the verdict was not a clean pass.
What do I still have to do myself?
On raw Postgres you must enforce per-user access in your own server code — rls.supabase.sql uses auth.uid() and only applies to Supabase. Keep the analytics views behind the service role: they read across all users and must never be granted to the client.
How do I get this code?
Download the Playground, start a new app, and tick “I might sell this business one day”. The block is written into your project as ordinary source you can read and edit.

All pre-built code blocks · Learn to build from zero · The coding guide