Adds two admin pages and a nav link: a lineage graph that traces which collections, globals and blocks feed into others, and a data model ERD with a table per collection and cardinality-labelled relationships. The views are built on the server from the running config and respect admin access plus an optional access function. Requires Payload 3 with Next.js 15 or 16 and React 19.
Lineage and data model (ERD) pages for the Payload admin: the collections, globals and blocks, and the fields that link them.
Installation
npm i @rocksoliddigital/payload-lineage0
Stars
0
Forks
2
Open Issues
1 months ago
Last Updated
120
Weekly Downloads
v0.4.0
npm Version
96.2 KB
Unpacked Size
2
Dependencies
00 since Oct 11
| Date | Stars |
|---|---|
| Dec 5, 2026 | 0 |
| Dec 4, 2026 | 0 |
| Dec 3, 2026 | 0 |
| Dec 2, 2026 | 0 |
| Dec 1, 2026 | 0 |
| Nov 30, 2026 | 0 |
| Nov 29, 2026 | 0 |
| Nov 28, 2026 | 0 |
| Nov 27, 2026 | 0 |
| Nov 26, 2026 | 0 |
| Nov 25, 2026 | 0 |
| Nov 24, 2026 | 0 |
| Nov 23, 2026 | 0 |
| Nov 22, 2026 | 0 |
| Nov 21, 2026 | 0 |
| Nov 20, 2026 | 0 |
| Nov 19, 2026 | 0 |
| Nov 18, 2026 | 0 |
| Nov 17, 2026 | 0 |
| Nov 16, 2026 | 0 |
| Nov 15, 2026 | 0 |
| Nov 14, 2026 | 0 |
| Nov 13, 2026 | 0 |
| Nov 12, 2026 | 0 |
| Nov 11, 2026 | 0 |
| Nov 10, 2026 | 0 |
| Nov 9, 2026 | 0 |
| Nov 8, 2026 | 0 |
| Nov 7, 2026 | 0 |
| Nov 6, 2026 | 0 |
| Nov 5, 2026 | 0 |
| Nov 4, 2026 | 0 |
| Nov 3, 2026 | 0 |
| Nov 2, 2026 | 0 |
| Nov 1, 2026 | 0 |
| Oct 31, 2026 | 0 |
| Oct 30, 2026 | 0 |
| Oct 29, 2026 | 0 |
| Oct 28, 2026 | 0 |
| Oct 27, 2026 | 0 |
| Oct 26, 2026 | 0 |
| Oct 25, 2026 | 0 |
| Oct 24, 2026 | 0 |
| Oct 23, 2026 | 0 |
| Oct 22, 2026 | 0 |
| Oct 21, 2026 | 0 |
| Oct 20, 2026 | 0 |
| Oct 19, 2026 | 0 |
| Oct 18, 2026 | 0 |
| Oct 17, 2026 | 0 |
| Oct 16, 2026 | 0 |
| Oct 15, 2026 | 0 |
| Oct 14, 2026 | 0 |
| Oct 13, 2026 | 0 |
| Oct 12, 2026 | 0 |
| Oct 11, 2026 | 0 |
151−20 since Oct 20
| Date | Weekly downloads |
|---|---|
| Dec 5, 2026 | 151 |
| Dec 4, 2026 | 168 |
| Dec 3, 2026 | 205 |
| Dec 2, 2026 | 214 |
| Dec 1, 2026 | 218 |
| Nov 30, 2026 | 218 |
| Nov 29, 2026 | 221 |
| Nov 28, 2026 | 171 |
| Nov 27, 2026 | 239 |
| Nov 26, 2026 | 219 |
| Nov 25, 2026 | 210 |
| Nov 24, 2026 | 208 |
| Nov 23, 2026 | 213 |
| Nov 22, 2026 | 151 |
| Nov 21, 2026 | 191 |
| Nov 20, 2026 | 120 |
| Nov 19, 2026 | 109 |
| Nov 18, 2026 | 167 |
| Nov 17, 2026 | 204 |
| Nov 16, 2026 | 210 |
| Nov 15, 2026 | 227 |
| Nov 14, 2026 | 199 |
| Nov 13, 2026 | 168 |
| Nov 12, 2026 | 162 |
| Nov 11, 2026 | 103 |
| Nov 10, 2026 | 70 |
| Nov 9, 2026 | 81 |
| Nov 8, 2026 | 67 |
| Nov 7, 2026 | 79 |
| Nov 6, 2026 | 247 |
| Nov 5, 2026 | 269 |
| Nov 4, 2026 | 269 |
| Nov 3, 2026 | 264 |
| Nov 2, 2026 | 252 |
| Nov 1, 2026 | 249 |
| Oct 31, 2026 | 235 |
| Oct 30, 2026 | 92 |
| Oct 29, 2026 | 64 |
| Oct 28, 2026 | 58 |
| Oct 27, 2026 | 286 |
| Oct 26, 2026 | 447 |
| Oct 25, 2026 | 445 |
| Oct 24, 2026 | 432 |
| Oct 23, 2026 | 400 |
| Oct 22, 2026 | 400 |
| Oct 21, 2026 | 400 |
| Oct 20, 2026 | 171 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/1422791428-payload-lineage)<a href="https://payloaddirectory.dev/plugins/1422791428-payload-lineage"><img src="https://payloaddirectory.dev/badge/1422791428-payload-lineage.svg" alt="Payload Directory"></a>README
The content side of lineage, from a Payload config, as two pages in the admin:
/admin/lineage): collections, globals and blocks, and the fields that link them,
read left to right from what each is built from to where it is used: media →
block:mediaBlock → pages. Hover a node to trace everything upstream and downstream; click it
for the fields behind each link./admin/lineage/schema): an ERD, with a table per collection and global listing
its fields, and a line from each field that references another collection, labelled with its
cardinality:| Label | Means |
|---|---|
many-to-one | One reference per document, which many documents can share |
many-to-many | A list of references: hasMany, or inside an array or blocks field |
one-to-one | A unique reference, or a global's single one (a global is one document) |
one-to-many | A global's list of references |
A "Lineage" link in the nav opens them. To try them, run the example.
Works with Payload 3 on Next.js 15 or 16, with React 19. Early days: what's next is on the roadmap.
👀 Explore
users that nothing points at.erDiagram in crow's-foot notation. Paste it into a PR, a
doc or a ticket, and GitHub, GitLab and most docs tools draw it.🔒 Access
access, showing only the collections and
globals they can read. Everything is checked and built on the server. See Access.🧩 Setup
payload.config.ts. Options for excluded slugs, access and the JSON file.buildContentGraph and buildSchema give the same data to scripts.pnpm add @rocksoliddigital/payload-lineage
Add the plugin to payload.config.ts:
import { lineagePlugin } from '@rocksoliddigital/payload-lineage';
export default buildConfig({
// ...
plugins: [lineagePlugin()],
});
Then update the import map, so the admin can find the pages. next dev does this on its own; for a
build, run:
pnpm payload generate:importmap
| Option | Default | |
|---|---|---|
adminView | true | The two admin pages and the nav link |
access | none | ({ user, payload }) => boolean, on top of admin access; see Access |
outputFile | none | Where to write the lineage graph as JSON on each start, outside production only |
exclude | [] | Slugs to leave out of both pages and the file; block:text names only that block |
enabled | true | Set to false to turn the plugin off |
Payload's own collections (payload-preferences, payload-migrations, ...) are always left out. If
the file can't be written (e.g. a read-only filesystem), Payload logs a warning and starts anyway.
To leave out form-builder's field blocks, which crowd the lineage graph:
lineagePlugin({
exclude: [
'checkbox',
'country',
'email',
'message',
'number',
'select',
'state',
'text',
'textarea',
].map((s) => `block:${s}`),
});
Or build either yourself, e.g. in a script, and keep a diagram in your docs up to date:
import {
buildContentGraph,
buildSchema,
contentGraphToMermaid,
schemaToMermaid,
} from '@rocksoliddigital/payload-lineage';
import config from '@payload-config';
const graph = buildContentGraph(await config);
const schema = buildSchema(await config);
const diagram = schemaToMermaid(schema); // or contentGraphToMermaid(graph)
The pages and their nav link are for users who can use the admin (Payload's access.admin on the
users collection, which Payload itself doesn't check on custom pages), and who pass the plugin's
access, if set:
lineagePlugin({ access: ({ user }) => user.role === 'admin' });
Anyone else is sent where Payload sends them for its own pages: the login page when logged out, the
unauthorized page when logged in, each with a redirect back. The pages show only the collections
and globals the user can read, along with every link to or from them; blocks have no access control
of their own, so they're all shown. Everything is checked and built on the server, so nothing a user
can't see reaches the browser.
{
"nodes": [
{ "id": "collection:media", "kind": "collection", "slug": "media", "label": "Media" },
{ "id": "block:mediaBlock", "kind": "block", "slug": "mediaBlock", "label": "Media Block" }
],
"edges": [
{
"source": "collection:media",
"target": "block:mediaBlock",
"kind": "upload",
"fields": ["media"]
}
]
}
Node ids are <kind>:<slug>, so they can't clash with the file paths the Storybook addon uses as
ids. source is the dependency and target what uses it, as in the Storybook addon. Join fields are
left out, since each is the reverse of a relationship that is already an edge. A collection that
links to itself, like nested-docs' parent, keeps the edge to itself.
buildSchema flattens groups, rows, collapsibles and tabs into dotted rows (hero.media), and keeps
each array and blocks field as one row (gallery[], layout). A reference inside one of those
attaches to that row, with its full path: layout[mediaBlock].media. Hidden fields (an auth
collection's salt and hash) and UI fields are left out. A join field is a row but not a line,
since it reverses a relationship that already is one.
payload plugin widgets
Dashboard widgets for KPI figures, lists and charts that read from your Payload collections
77536/wk2v3 v4
payload theme
shadcn-style redesign of the Payload admin with dashboard, command palette, dark mode and live theme customizer
751.8k/wk36v3
payload solid admin bar
WordPress-style admin bar shown in the Payload admin and on the Next.js website for logged-in editors
6596/wk0v3
templates
Managed template documents with read-time inheritance into collection fields
6228/wk0v4
reset list view
Adds a Reset Preferences button to collection list views to restore default columns, filters and pagination
57314/wk183v3
payload iframe tabs plugin
Add iframe tabs to collection and global edit views in the Payload admin panel
4212/wk25v2