Skip to content
KeystoneJS LogoKeystoneJSv5

atTracking

Adds createdAt and updatedAt fields to a list. These fields are read-only but they will be updated automatically when items are created or updated.

Usage

const { atTracking } = require('@keystonejs/list-plugins');

keystone.createList('ListWithPlugin', {
  fields: {
    // ...
  },
  plugins: [
    atTracking({
      /* ...config */
    }),
  ],
});

Config

OptionTypeDefaultDescription
createdAtFieldStringcreatedAtName of the createdAt field.
updatedAtFieldStringupdatedAtName of the createdAt field.
formatStringMM/DD/YYYY h:mm AFormat of the generated DateTime field.
accessObjectSee: accessChange default access controls.

access

By default access control on at tracking fields is read only:

{
  read: true,
  create: false,
  update: false
}

Disabling created or updated

You can import either createdAt or updatedAt to apply a single tracking field:

const { createdAt, updatedAt } = require('@keystonejs/list-plugins');

Note: The API is the same.

Have you found a mistake, something that is missing, or could be improved on this page? Please edit the Markdown file on GitHub and submit a PR with your changes.

Edit Page