Docs · Edit mode

Who may edit

Who may edit a page, and the four places clayjs looks to decide, in order.

Saving requires edit mode. On the platforms, you never think about this: hyperclay.com arms it with a cookie when you're the owner, and Hyperclay Local and HTML Clay arm it for local files automatically. Resolution order:

PrioritySource
1?editmode=true / ?editmode=false in the URL
2window.clayEditMode set before clay.js loads
3A save token the host put on the root element
4The platform's owner cookie

The token sits above the cookie because it is the stronger claim: the host issued it for this document, while a cookie is ambient. A sandboxed document cannot read a cookie at all.

Serving files from your own server? Arm it yourself:

<script>window.clayEditMode = true</script>
<script src="https://clayjs.com/v1/clay.js"></script>

Edit mode is client-side behavior. Whether a save is accepted is always the server's decision.