npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

strapi-plugin-timeline

v0.0.8

Published

Content history and version control plugin for Strapi 5. Track changes, browse history, compare diffs, and restore previous versions.

Readme

Strapi Timeline Plugin

A content history and version control plugin for Strapi 5. Automatically tracks changes to your content entries and lets you browse, compare, and restore previous versions — all from within the Strapi admin panel.

Package Moved

The package has moved from strapi-plugin-timeline to @xbstracts/strapi-plugin-timeline. Please use the new package name for future installs and updates.

Features

  • Automatic Change Tracking — Records snapshots on create, update, delete, and publish actions via lifecycle hooks. No manual work required.
  • Per-Content-Type Configuration — Choose which content types to track, which actions to log, and set retention limits independently for each.
  • Full Snapshot Storage — Each timeline entry stores the complete content payload and the content type schema at that point in time.
  • Restore with Diff Preview — Before restoring, see a side-by-side comparison of what will change. One-click restore reverts the entry and logs a "restore" action.
  • Homepage Dashboard — Filterable, sortable, paginated table of all timeline entries across content types, users, locales, actions, and date ranges.
  • CM Edit View Panel — A sidebar panel in the content manager showing the history of the document you're editing, grouped by date.
  • Locale Aware — Tracks i18n locale per entry. Filter by locale. Restores respect locale context.
  • Scheduled Cleanup — Configure a cron job to automatically remove entries older than a retention duration (hours, days, weeks, or months).
  • Entries Limit — Set a maximum number of entries per content type. Oldest entries are automatically pruned (FIFO).
  • Role-Based Permissions — Separate permissions for read, edit, delete, and schedule actions via Strapi's RBAC system.
  • User Attribution — Captures the admin user who performed each action, with links to user profiles.
  • Schema Migration — Automatically migrates from legacy configuration format.

Requirements

  • Strapi v5.x (>=5.0.0 <6.0.0)
  • Node.js 18+

Installation

npm install strapi-plugin-timeline

Or with yarn:

yarn add strapi-plugin-timeline

Enable the Plugin

Add it to your Strapi plugin configuration:

// config/plugins.ts
export default () => ({
  timeline: {
    enabled: true,
  },
});

Then rebuild and restart your Strapi application.

Configuration

All configuration is done through the Strapi Admin Panel — no code changes needed.

Settings Page

Navigate to Settings → Timeline in the admin panel to:

  1. Add content types to track from a dropdown of all available API content types.
  2. Configure each content type independently:
    • Enable/Disable — Toggle tracking on or off.
    • Tracked Actions — Select which actions to log: create, update, delete, publish. Leave empty to track all.
    • Entries Limit — Maximum entries to keep (0 = unlimited). When exceeded, oldest entries are removed automatically.
    • Retention Duration — How long to keep entries before scheduled cleanup removes them. Set the value and unit (hours, days, weeks, months).
  3. Remove content types — Stop tracking and optionally clean up existing entries.

Scheduled Cleanup

Navigate to Settings → Timeline → Schedule to:

  • Enable/Disable automatic cleanup.
  • Set the cron expression (default: 0 * * * * — every hour).
  • Run cleanup manually with the "Run Now" button.
  • View last cleanup results including per-content-type deletion counts.

Note: Changes to the cron schedule require a server restart to take effect.

Usage

Homepage

The Timeline homepage (/plugins/timeline) shows a paginated table of all tracked changes. You can:

  • Filter by content type, user, action, locale, date range, or document ID.
  • Sort by action, content type, user, or date.
  • View — Click the eye icon to open a detail modal showing the full snapshot with formatted content (rich text, blocks, relations, media).
  • Restore — Click the restore icon to open a diff preview, then confirm to revert the entry to that snapshot.
  • Clean — Bulk delete timeline entries by content type.

Content Manager Panel

When editing any tracked content entry, a Timeline panel appears in the sidebar showing:

  • Recent changes to this specific document, grouped by date.
  • A date picker to browse changes on a specific day.
  • Quick view and restore buttons for each entry.

Restore

When you restore a snapshot:

  1. A diff table shows which fields will change, comparing current values against the snapshot.
  2. The plugin performs the restore server-side in a single operation.
  3. A "restore" action is logged in the timeline.
  4. The entries limit is enforced after the restore.
  5. The lifecycle afterUpdate hook is suppressed during restore to avoid a duplicate "update" entry.

Tracked Actions

| Action | Description | |--------|-------------| | create | A new entry was created | | update | An existing draft/entry was modified | | publish | Content was published | | delete | An entry was deleted | | restore | An entry was reverted to a previous snapshot | | clean | Timeline entries were manually bulk-deleted |

Permissions

The plugin registers its own permissions under Settings → Roles:

| Permission | Description | |------------|-------------| | plugin::timeline.read | View timeline entries and history | | plugin::timeline.edit | Restore entries and modify settings | | plugin::timeline.delete | Delete / clean timeline entries | | plugin::timeline.schedule.run | Execute scheduled cleanup |

API Endpoints

All endpoints are admin-only and require authentication.

| Method | Endpoint | Description | |--------|----------|-------------| | GET | /timeline/settings | Get plugin settings | | PUT | /timeline/settings | Update plugin settings | | GET | /timeline/content-types | List available content types | | GET | /timeline/entries | Query timeline entries (with filters, pagination, sorting) | | GET | /timeline/entries/users | Get distinct users | | GET | /timeline/entries/locales | Get distinct locales | | GET | /timeline/entries/:contentType/:entryDocumentId | Get history for a specific document | | POST | /timeline/entries/snapshot-before-restore | Restore an entry to a previous snapshot | | POST | /timeline/entries/clean | Delete entries for selected content types | | DELETE | /timeline/entries | Delete all timeline entries | | GET | /timeline/schedule | Get cleanup schedule status | | PUT | /timeline/schedule | Update cleanup schedule | | POST | /timeline/schedule/run | Run cleanup now |

How It Works

The plugin subscribes to Strapi's database lifecycle events (afterCreate, afterUpdate, beforeDelete) at the global level. On each event:

  1. Checks if the content type is tracked and the action is enabled in settings.
  2. Extracts the admin user from the request context.
  3. Resolves relation fields to document IDs.
  4. Captures the content type schema (attributes, types, relations).
  5. Stores the full snapshot as a JSON timeline entry.
  6. Enforces the entries limit by removing the oldest entries if exceeded.

Snapshots are stored in the plugin's own timeline-entry collection type, hidden from the content manager.

License

MIT — Patiparnne Vongchompue

Support

If you find this plugin useful, consider supporting the development: