Skip to main content

Global Object

The Global object is available when building backend API steps or writing frontend JavaScript within Applications. It holds metadata such as the current URL, the end-user accessing the application, or the browser's local storage. This metadata can be used to reference a user's groups in code or access the query parameters to dynamically pass data between applications. Use CMD/CTRL + k to pull up the Global object as well as other available variables in backend API steps or when writing JavaScript inside frontend components.

Application created and deployed times are presented in ISO 8601 string format. These can be modified into other formats such as with JavaScript's moment library:

{{moment(Global.deployedAt).format("MM/DD/YYYY HH:mm:ss")}}

Available metadata‚Äč

Metadata typePropertyDescriptionFull Path
ApplicationcreatedAtThe application creation time in ISO 8601 string (UTC)Global.createdAt
ApplicationdeployedAtThe application deployment time in ISO 8601 string (UTC)Global.deployedAt
ApplicationmodeThe mode the application is in when the user views it EDIT, PREVIEW, or PUBLISHEDGlobal.mode
UseremailThe email associated with the end-user viewing and using the applicationGlobal.user.email
UsergroupsAn array of all the groups of which the end-user viewing and using the application is a memberGlobal.user.groups
UseridThe id associated with the end-user viewing and using the applicationGlobal.user.id
UserusernameThe username associated with the end-user viewing and using the applicationGlobal.user.username
GroupsgroupsAn array of all the permissions groups in your Superblocks organizationGlobal.groups
URLfullpathA string representation of the full URL of the applicationGlobal.URL.fullpath
URLhostThe host component of the URL (e.g. app.superblockshq.com)Global.URL.host
URLpathnameThe path component of the URL (e.g. /applications/123/pages/456)Global.URL.pathname
URLqueryParamsAn object containing key-value pairs representing the query parameters present in the URL.Global.URL.queryParams
URLstoreAn object containing key-value pairs representing the contents of the browser's local storageGlobal.URL.store