Skip to main content

Read runtime context

const context = await host.getContext();

The returned AppHostContext contains:

FieldMeaning
protocolVersionHost protocol version; currently 1
installationIdCurrent account-scoped app installation
appKey, appVersionInstalled app identity
surfaceKeyFrontend Page surface currently open
locale, timezoneOrganization/user rendering context
capabilitiesAvailable semantic operations
bindings.dataWorkspacesResolved Data Workspace binding aliases
bindings.workflowsResolved workflow binding aliases
themeApp color and light or dark scheme
if (context.capabilities.includes('workflow.run')) {
enableGenerateButton();
}

document.documentElement.dataset.theme = context.theme.colorScheme;

Bindings contain only IDs explicitly mapped by the Frontend Page resource. Do not cache them across installations.