@agility/web-studio-sdk
Version:
Standard Development Kit used to enable Web Studio features in Agility CMS
13 lines (10 loc) • 371 B
text/typescript
export const getGuid = (file: string): string | null => {
const guid = document.body.getAttribute("data-agility-guid")
if (!guid) {
console.error(
`%cWeb Studio SDK\n - Error In:${file} no guid found on body element. \nMake sure your body element is set up like this: <body data-agility-guid='{{agilityguid}}'>`
)
return null
}
return guid
}