onpage core

Framework-agnostic core for click-to-edit draft previews that save through Payload's REST API.

Community 0 1.4k/wk MIT v0.5.0

Installation

pnpm add @payload-onpage/core

About

The core package holds the parts of payload-onpage that do not depend on a framework: document references, schema handling, field operations, the stega codec for marking editable text in rendered HTML, autosave, the editor session, and the port interfaces that adapters implement. It is not a Payload plugin on its own. The `@payload-onpage/plugin` package registers the server side, and framework packages for Next.js and TanStack Start supply the session and rendering pieces. The default data adapter, `payloadRest()`, reads and writes documents through Payload's REST API with the logged-in user's cookies. Saves go out as PATCH requests with `draft` and `autosave` set, or as a publish with `_status` set to published, so Payload's access control, hooks, validation, drafts, and versions apply the same way they do in the admin. Saves can send an `If-Unmodified-Since` header so the server can reject a write when someone else saved first. A `payloadUploads()` adapter covers the media library over an upload collection. The package exposes DataSource, MediaLibrary, Locator, Renderer, and SessionAdapter as swappable ports. The DataSource port also has optional methods for scheduled publishing, field conditions, document locks, version restore, comments, review requests, page duplication, and saved sections. Each optional method only appears when the adapter implements it. Field editors are registered in `@payload-onpage/react`, not here, so this package has no React components of its own.

Package info

Package name
@payload-onpage/core
Latest version
0.5.0
Unpacked size
271 kB
License
MIT
Weekly downloads
1.4k
Last publish
Oct 12, 2026

More from jellologic

View profile

Similar plugins

More in Content