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

[Docs](https://clayjs.com/docs) · Offline

# One file, no network

`clay.js` is a 3 KB bootstrap that fetches the modules a page asked for. The standalone build is every one of those modules in a single readable file. Download it once, keep it beside your HTML, and the page loads with no connection at all.

Download

## clay.standalone.js

[Download clay.standalone.js](https://clayjs.com/v1/clay.standalone.js)

About 1 MB of readable source. MIT-0 for the clayjs code; the third-party notices for the libraries inside are on the first lines of the file. `/v1/clay.standalone.js` is the newest 1.x; `/1.1.0/clay.standalone.js` is that exact release, forever. The first line of the file names its version. It is also in the npm package, at `dist/clay.standalone.js`.

Use

## The same tag, pointed at the file

```html
<script src="clay.standalone.js?plugins=sync"></script>
```

Same query params as `clay.js`: `plugins` and `exclude`. Everything is inside the file, so `plugins=` decides what runs, not what downloads. The [satellites](https://clayjs.com/advanced) are inside too: `await clay.loaded.ui`, `clay.loaded.sap` and the rest work without a tag of their own.

Always on means always on: the ui satellite's automatic `Saved` and `Couldn't save` toasts run on your page, and the element helpers (`el.nearest`, `el.val` and friends) are installed, whether or not you asked. Listen for the `clay:save-*` events yourself if you want your own feedback. If your page already had satellite tags, delete them: a second `sap.js` mounts a second runtime and every action runs twice.

The file never changes under you. A page depends on the bytes it has, not on a server. You can even paste the whole file into a `<script>` block; the query params then have nowhere to go, so the defaults apply.

Saving

## Offline still needs a writer

The library is now on your disk. Saving is a separate job: something has to take the edited document and write the bytes. [HTML Clay](https://htmlclay.com/) does that on the machine itself, with no network. It serves the file at `127.0.0.1`, stamps the save token that switches clayjs into edit mode, and writes every save back to disk. Wi-Fi off, everything works.

A file opened straight from disk (`file://`) loads and renders, but has nowhere to post a save to. It stays in view mode unless you force edit mode, and then a save reports an error and your edits stay in the tab.

Two exceptions

## What still reaches out

Both are opt-in, and both fail soft.

| What | When | Offline |
| --- | --- | --- |
| The CMS sidebar's font, from jsDelivr | `plugins=cms` | Falls back to your system monospace. The sidebar works the same. |
| A diff library, from esm.sh | Autosave debugging, switched on with `localStorage.setItem("clay:debug:autosave", "true")` | The debug log loses its diffs. Autosave itself is unaffected. |

Updating

## When you want a newer clayjs

Download again and replace the file. Nothing else changes: the tag, the params and your document stay as they are. To see what you have, read the first line of the file.

The rolling `/v1/` URL updates on its own for pages that load from the network. A file you downloaded does not, on purpose.
