Reference
The core API, the attributes, the events, and the one endpoint that makes it all work, one part per page. For the guided version, start with the tutorial. To build a whole app, read the guide.
/v1/clay.js?plugins=?exclude=versions.json
Core API
Everything on window.clay: saving, reading and writing data, edit mode, and what each plugin adds.
clay.readyclay.save()clay.hasUnsavedChanges()clay.writeData()clay.conflicts
Attributes
The HTML surface: rich text, saved form values, autosave, regions and owner-only behavior.
editablepersistautosaveclay="…"editmode:onclick
Events
What fires on document as a page boots, saves, goes dirty and receives live sync.
clay:readyclay:save-savedclay:dirtyclay:sync-applied
Edit mode
Who may edit a page, and the four places clayjs looks to decide, in order.
?editmode=truewindow.clayEditModesave tokenowner cookie
Host it yourself
The one route a host implements, and a complete server in a couple dozen lines of Express.
POST /_/saveDocument-URLExpress
Offline
The standalone build: every module in one file, for pages that load with no network.
clay.standalone.js?plugins=HTML Clay
Low level
clay.internals, for code that sits inside the save lifecycle instead of calling it.
captureSnapshot()captureForSave()region.*save.saveHtml()
Example apps
Four complete apps, each one HTML file, to open, download and build from.
skeleton.htmlkanban.htmlwriter.htmlfinance.html