Docs · Script tag

The script tag

The script tag, versioned URLs, and loading plugins through the query string.

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

Every clayjs URL carries a version, because a saved document hardcodes its script tag and there is no way to reach it afterwards to change it. Two forms:

URLWhat it serves
/v1/clay.jsThe newest 1.x release. Rolls forward with fixes and features, never across a major version.
/1.0.0/clay.jsThat exact release, forever. Cached for a year as immutable.
/v1/clay.standalone.jsThe whole library in one file, for a page that must load with no network. Same query params. Details on Offline.

Use /v1/ unless you have a reason not to. Both forms exist for every satellite, so /v1/clay-ui.js and /1.0.0/sap.js work the same way. Published versions are listed at versions.json. There is no unversioned URL: clayjs.com/clay.js was retired at 1.0 and returns 404.

The default build includes the save lifecycle and rich text (editable). Plugins load conditionally through the URL, in the browser only:

ParamMeaningExample
pluginsComma-separated plugins to loadclay.js?plugins=sync,undo
excludeRemove a default-on pluginclay.js?exclude=richclay

Loadable plugins: richclay (default on), source (default on), indicator, sync, sortable, undo, cms, quickcrop, upload, people, wire, ai-edit, demo. Turn a default-on plugin off with exclude=. Seven have a checkbox in the configurator; ask for the rest by name. The configurator composes this URL for you. Everything else is a separate library with its own script tag: see Advanced and Plugins. npm builds for bundlers live at @panphora/clayjs. For a page with no network at all, the standalone build is every module in one downloadable file.