b3nab

payload hypervalue

by b3nab
payload-hypervalue
Databases & data
v3
^3.79.0

Overview

Summary generated from the README

Records changes to Payload fields or whole collections as time-series history in TimescaleDB hypertables. Tracking is enabled with a custom hypervalue flag on a collection or field, and history is read through a local API method or REST endpoints. Requires Payload 3.79 or newer with the Postgres adapter and TimescaleDB 2.15 or newer.

Features

  • Collection-level tracking stores full snapshots in one wide hypertable
  • Field-level tracking gives each field its own narrow hypertable
  • Query history by document, field, point in time or date range
  • REST endpoints for collection snapshots and single field history
  • Options for chunk interval, compression, retention and draft tracking
  • Supports number, text, select, checkbox, date, json and relationship fields

Use cases

  • Store sensor readings such as temperature and query them over a date range
  • Keep price history for products and look up the value at a past date
  • Retain document snapshots with automatic compression and expiry of old chunks

From the author

A Payload CMS plugin to track and store scalar fields in time-series history using Postgres and TimescaleDB

Installation

npm i @b3nab/payload-hypervalue

4

Stars

0

Forks

0

Open Issues

8 months ago

Last Updated

0

Weekly Downloads

v

npm Version

Dependencies

GitHub stars

40 since Sep 6

Show data
GitHub stars by day (UTC)
DateStars
Dec 5, 20264
Dec 4, 20264
Dec 3, 20264
Dec 2, 20264
Dec 1, 20264
Nov 30, 20264
Nov 29, 20264
Nov 28, 20264
Nov 27, 20264
Nov 26, 20264
Nov 25, 20264
Nov 24, 20264
Nov 23, 20264
Nov 22, 20264
Nov 21, 20264
Nov 20, 20264
Nov 19, 20264
Nov 18, 20264
Nov 17, 20264
Nov 16, 20264
Nov 15, 20264
Nov 14, 20264
Nov 13, 20264
Nov 12, 20264
Nov 11, 20264
Nov 10, 20264
Nov 9, 20264
Nov 8, 20264
Nov 7, 20264
Nov 6, 20264
Nov 5, 20264
Nov 4, 20264
Nov 3, 20264
Nov 2, 20264
Nov 1, 20264
Oct 31, 20264
Oct 30, 20264
Oct 29, 20264
Oct 28, 20264
Oct 27, 20264
Oct 26, 20264
Oct 25, 20264
Oct 24, 20264
Oct 23, 20264
Oct 22, 20264
Oct 21, 20264
Oct 20, 20264
Oct 19, 20264
Oct 18, 20264
Oct 17, 20264
Oct 16, 20264
Oct 15, 20264
Oct 14, 20264
Oct 13, 20264
Oct 12, 20264
Oct 11, 20264
Oct 10, 20264
Oct 9, 20264
Oct 8, 20264
Oct 7, 20264
Oct 6, 20264
Oct 5, 20264
Oct 4, 20264
Oct 3, 20264
Oct 2, 20264
Oct 1, 20264
Sep 30, 20264
Sep 29, 20264
Sep 28, 20264
Sep 27, 20264
Sep 26, 20264
Sep 25, 20264
Sep 24, 20264
Sep 23, 20264
Sep 22, 20264
Sep 21, 20264
Sep 20, 20264
Sep 19, 20264
Sep 18, 20264
Sep 17, 20264
Sep 16, 20264
Sep 15, 20264
Sep 14, 20264
Sep 13, 20264
Sep 12, 20264
Sep 11, 20264
Sep 10, 20264
Sep 9, 20264
Sep 8, 20264
Sep 7, 20264
Sep 6, 20264
npm weekly downloads

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

18/100Poor

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/1175545924-payload-hypervalue.svg)](https://payloaddirectory.dev/plugins/1175545924-payload-hypervalue)
HTML
<a href="https://payloaddirectory.dev/plugins/1175545924-payload-hypervalue"><img src="https://payloaddirectory.dev/badge/1175545924-payload-hypervalue.svg" alt="Payload Directory"></a>
Updated Mar 21, 2026Created Mar 7, 2026

README

@b3nab/payload-hypervalue

Time-series history tracking for Payload CMS fields and collections, powered by TimescaleDB hypertables.

Install

pnpm add @b3nab/payload-hypervalue

Usage

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
        },
      ],
    },
  ],
});

Tracking Modes

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.

Querying

// 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

Plugin Options

OptionTypeDefaultDescription
chunkIntervalstring'3 months'TimescaleDB chunk time interval
compressionAfterstring—Compress chunks older than this interval
retentionAfterstring—Auto-drop chunks older than this interval
trackDraftsbooleanfalseRecord changes on draft saves
disabledbooleanfalseDisable the plugin at runtime

Supported Field Types

number, text, select, checkbox, date, json, relationship

Requirements

  • Payload ^3.79.0 with @payloadcms/db-postgres
  • PostgreSQL with TimescaleDB 2.15+
  • Node ^18.20.2 or >=20.9.0

Docs

payload-hypervalue.abbenanti.com

License

MIT

Similar plugins