onpage core
Framework-agnostic core for click-to-edit draft previews that save through Payload's REST API.
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 profileonpage for TanStack Start
Adds on-page editing and draft previews to TanStack Start sites that read content from Payload.
On-Page React Editor
Adds an inline visual editor UI for Payload pages, with toolbars, field editors, and element annotations for React front ends.
OnPage for Next.js App Router
Adds inline editing and draft previews to Next.js App Router pages backed by Payload, with a sealed preview session and an OnPage component.
On-Page Editing
Adds inline on-page editing, draft preview links, and an admin button to edit Payload pages in place on a Next.js front end.
Lexical Inline Rich Text Editor
Adds click-to-edit inline rich text editing for Payload Lexical richText fields on the front end.