⚠️ Work in progress — createCMS is pre-1.0 and not production-ready (not tested in production). Expect breaking changes.
createCMS
Reference

Variables

Reusable values substituted into content, via cms.api.variables.

Variables are reusable values referenced in content as {{key}} and substituted on read (in getBlockTree and getPublishedContent, unless raw: true). Methods live under cms.api.variables.

MethodHTTPInputReturns
listVariablesGET{ variables }
getVariableGETquery: { key }{ variable, inUse }
createVariablePOSTbody: { key, value, description? }{ variable }
updateVariablePOSTbody: { key, value?, description? }{ variable }
deleteVariablePOSTbody: { key }{ deleted }
getVariableUsagesGETquery: { key }usage counts and sites

A key is alphanumeric plus underscores. Updating a variable's value revalidates the published roots that use it. Deleting one that is in use throws VARIABLE_IN_USE.

Reference a variable in any string property, for example { title: 'Hello {{siteName}}' }. An unknown key is left literal.