<!-- Docs · clayjs · https://clayjs.com/docs · generated from the page; every page has one at its path plus .md -->

# 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](https://clayjs.com/). To build a whole app, read the [guide](https://clayjs.com/guide).

-   [The script tag](https://clayjs.com/docs/script-tag): The script tag, versioned URLs, and loading plugins through the query string. Covers `/v1/clay.js`, `?plugins=`, `?exclude=`, `versions.json`.
-   [Core API](https://clayjs.com/docs/api): Everything on window.clay: saving, reading and writing data, edit mode, and what each plugin adds. Covers `clay.ready`, `clay.save()`, `clay.hasUnsavedChanges()`, `clay.writeData()`, `clay.conflicts`.
-   [Attributes](https://clayjs.com/docs/attributes): The HTML surface: rich text, saved form values, autosave, regions and owner-only behavior. Covers `editable`, `persist`, `autosave`, `clay="…"`, `editmode:onclick`.
-   [Events](https://clayjs.com/docs/events): What fires on document as a page boots, saves, goes dirty and receives live sync. Covers `clay:ready`, `clay:save-saved`, `clay:dirty`, `clay:sync-applied`.
-   [Edit mode](https://clayjs.com/docs/edit-mode): Who may edit a page, and the four places clayjs looks to decide, in order. Covers `?editmode=true`, `window.clayEditMode`, `save token`, `owner cookie`.
-   [Host it yourself](https://clayjs.com/docs/endpoint): The one route a host implements, and a complete server in a couple dozen lines of Express. Covers `POST /_/save`, `Document-URL`, `Express`.
-   [Offline](https://clayjs.com/docs/offline): The standalone build: every module in one file, for pages that load with no network. Covers `clay.standalone.js`, `?plugins=`, `HTML Clay`.
-   [Low level](https://clayjs.com/docs/internals): clay.internals, for code that sits inside the save lifecycle instead of calling it. Covers `captureSnapshot()`, `captureForSave()`, `region.*`, `save.saveHtml()`.
-   [Example apps](https://clayjs.com/docs/examples): Four complete apps, each one HTML file, to open, download and build from. Covers `skeleton.html`, `kanban.html`, `writer.html`, `finance.html`.
