Stores the history of scalar field values in TimescaleDB hypertables. Tracking is enabled per collection or per field through a custom flag in the config. History can be queried with a local API method or REST endpoints, including point-in-time and range queries. Requires the Postgres adapter and TimescaleDB 2.15 or newer.
A Payload CMS plugin to track and store scalar fields in time-series history using Postgres and TimescaleDB
Installation
npm i @b3nab/payload-hypervalue4
Stars
0
Forks
0
Open Issues
7 months ago
Last Updated
0
Weekly Downloads
v
npm Version
Dependencies
Trends appear after 7 days of data. Daily snapshots have not started yet.
Trends appear after 7 days of data. Daily snapshots have not started yet.
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/1175545924-payload-hypervalue)<a href="https://payloaddirectory.dev/plugins/1175545924-payload-hypervalue"><img src="https://payloaddirectory.dev/badge/1175545924-payload-hypervalue.svg" alt="Payload Directory"></a>README
Time-series history tracking for Payload CMS fields and collections, powered by TimescaleDB hypertables.
pnpm add @b3nab/payload-hypervalue
import { buildConfig } from "payload";
import { payloadHypervalue } from "@b3nab/payload-hypervalue";
export default buildConfig({
plugins: [payloadHypervalue()],
collections: [
{
slug: "products",
custom: { hypervalue: true }, // collection-level: track all scalar fields
fields: [
{ name: "title", type: "text" },
{ name: "price", type: "number" },
{ name: "status", type: "select", options: ["draft", "published"] },
],
},
{
slug: "sensors",
fields: [
{
name: "temperature",
type: "number",
custom: { hypervalue: true }, // field-level: track just this field
},
],
},
],
});
Collection-level — Add custom: { hypervalue: true } to a collection. All scalar fields are tracked in a single wide hypertable (hv_{collection}). Every update stores a full snapshot.
Field-level — Add custom: { hypervalue: true } to individual fields. Each gets its own narrow hypertable (hv_{collection}_{field}).
Both modes can coexist on the same collection.
// Collection-level — full document snapshots
const snapshots = await payload.hypervalue({
collection: "products",
id: productId,
});
// Field-level — single field history
const history = await payload.hypervalue({
collection: "sensors",
id: sensorId,
field: "temperature",
});
// Point-in-time
const snapshot = await payload.hypervalue({
collection: "products",
id: productId,
at: new Date("2025-06-01"),
});
// Range
const range = await payload.hypervalue({
collection: "sensors",
id: sensorId,
field: "temperature",
from: new Date("2025-01-01"),
to: new Date("2025-06-01"),
});
REST endpoints:
GET /api/hypervalue/:collection/:id # collection-level snapshots
GET /api/hypervalue/:collection/:id/:field # field-level history
| Option | Type | Default | Description |
|---|---|---|---|
chunkInterval | string | '3 months' | TimescaleDB chunk time interval |
compressionAfter | string | — | Compress chunks older than this interval |
retentionAfter | string | — | Auto-drop chunks older than this interval |
trackDrafts | boolean | false | Record changes on draft saves |
disabled | boolean | false | Disable the plugin at runtime |
number, text, select, checkbox, date, json, relationship
^3.79.0 with @payloadcms/db-postgres^18.20.2 or >=20.9.0payload-hypervalue.abbenanti.com
MIT
payload plugin janitor
Find orphaned files, missing uploads and unreferenced documents, then delete only what you approve
7031/wk5v4
payload upstash
Upstash Redis key-value adapter for Payload's built-in KV store
690/wk7v3
payload revalidate
Field-driven Next.js cache revalidation and tagged cached finders for Payload collections and globals
67151/wk18v3
payload locale snapshot
Preserves other-locale rows of localized blocks and arrays when saving documents on the PostgreSQL adapter
650/wk3v3
payload collection references
Cascade-delete or unlink documents that reference a deleted document in relationship and upload fields
593/wk2v3
switch env
Switch the local admin between development and production databases and copy production data into development
590/wk15v3