Basics
Features
Best Practices
Addon Development
Related Docs
Dark Mode

#State

You can call the Addon State endpoint to get information about your Addon and the CMS.

// use axios
let response = await axios.get(`http://localhost:${cmsPort}/api/addon/${addonId}/state`)
console.log(response.data.cms) // cms state
console.log(response.data.state) // addon state

// use static-cms-addon
import cms from 'static-cms-addon'
let cmsState = await cms.getCmsState()
let state = await cms.getState()
console.log(cmsState) // cms state
console.log(state) // addon state

#Addon State

KeyFunctionExample Value
namecms.getAddonName()"my-addon"
codePathcms.getCodePath()"/home/ubuntu/sites/my-site/local/cms/addon/my-addon/code"
storagePathcms.getStoragePath()"/home/ubuntu/sites/my-site/local/cms/addon/my-addon/storage"
sidebarItemscms.getSidebarItems()(array of Sidebar items)
helpcms.getHelp()(array of Help Pages)

#CMS State

KeyFunctionValue
assetPathcms.getAssetPath()"/home/ubuntu/sites/my-site/local/cms/asset"
isDevelopmentModeEnabledcms.isDevelopmentModeEnabled()true
isTrailingSlashEnabledcms.isTrailingSlashEnabled()true
namecms.getSiteName()"My Site"
timezonecms.getTimezone()"America/New_York"
uuidcms.getUuid()"896559c8-a7d0-44f5-9f12-f5862f66f110"