Skip to main content

Config

getConfig()

Returns a promise resolved with the config object containing basic info about the currently logged-in account.

customerId and adminId are not suited for authentication — use an Authentication Token instead. Works in iframes if the UI Kit and window.e.config are present on the top window.

Usage: window.e.utils.v2.config.getConfig()

Returns: Promise<config>

FieldTypeDescription
accountTimezonestringTimezone of the customer account
adminFirstNamestringFirst name of logged-in admin
adminIdnumberadminId of logged-in admin
adminLastNamestringLast name of logged-in admin
customerIdnumbercustomerId of logged-in customer account
dateFormatstringPreferred date format of logged-in admin
environmentstringName (domain) of current environment
enviromentHoststringName (domain) of current UI host
featuresarrayEnabled features for the account
flippersarrayTurned-on flippers for the account
isoLanguageCodestringLong language code
languagestringPreferred language of logged-in admin
sessionIdnumberPublic id of current session
timeFormatstringPreferred time format of logged-in admin
timezonestringTimezone setting for logged-in admin

getCurrentConfig()

Same as getConfig() but returns the current config state synchronously without requesting the latest from the Suite frame. No guarantee it matches Suite's current state.

Works in iframes if window.e.config is present on the window.

Usage: window.e.utils.v2.config.getCurrentConfig()


getFeatureService()

Returns a promise resolved with the FeatureService for handling feature switches for the current customer.

Usage: window.e.utils.v2.config.getFeatureService()

Methods

MethodDescription
isOn(featureName)Returns true if the feature is turned on
isOff(featureName)Returns true if the feature is turned off

Example

const featureService = await window.e.utils.v2.config.getFeatureService();
if (featureService.isOn('my_feature')) {
console.log('my_feature is on');
}

getFlipperService()

Returns a promise resolved with the FlipperService for handling flipper switches for the current customer.

Usage: window.e.utils.v2.config.getFlipperService()

Methods

MethodDescription
isOn(flipperName)Returns true if the flipper is turned on
isOff(flipperName)Returns true if the flipper is turned off

Example

const flipperService = await window.e.utils.v2.config.getFlipperService();
if (flipperService.isOn('myFlipper')) {
console.log('myFlipper is on');
}

isConsentAccepted({ consentId })

Calls the Account Data service to check if a consent has been accepted.

If a feature requires consent that hasn't been accepted, disable it with a tooltip: "To access [feature name] the Account owner has to accept the SAP Engagement Cloud AI Terms. You can review the document under Consent Management."

Usage: window.e.utils.v2.config.isConsentAccepted({ consentId })

Parameters

NameTypeRequiredDescription
consentIdstringyesId of the consent

Returns: Promise — resolves to true or false.

Example

const result = await window.e.utils.v2.config.isConsentAccepted({ consentId: 'consentToCheck' });
if (!result) { return; } else { return renderFunctionalityBehindConsent(); }