Config
getConfig()
Returns a promise resolved with the config object containing basic info about the currently logged-in account.
customerIdandadminIdare not suited for authentication — use an Authentication Token instead. Works in iframes if the UI Kit andwindow.e.configare present on the top window.
Usage: window.e.utils.v2.config.getConfig()
Returns: Promise<config>
| Field | Type | Description |
|---|---|---|
accountTimezone | string | Timezone of the customer account |
adminFirstName | string | First name of logged-in admin |
adminId | number | adminId of logged-in admin |
adminLastName | string | Last name of logged-in admin |
customerId | number | customerId of logged-in customer account |
dateFormat | string | Preferred date format of logged-in admin |
environment | string | Name (domain) of current environment |
enviromentHost | string | Name (domain) of current UI host |
features | array | Enabled features for the account |
flippers | array | Turned-on flippers for the account |
isoLanguageCode | string | Long language code |
language | string | Preferred language of logged-in admin |
sessionId | number | Public id of current session |
timeFormat | string | Preferred time format of logged-in admin |
timezone | string | Timezone 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.configis 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
| Method | Description |
|---|---|
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
| Method | Description |
|---|---|
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
| Name | Type | Required | Description |
|---|---|---|---|
consentId | string | yes | Id 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(); }