Config

The config utility is used to retrieve the config object that contains basic information about the currently logged in account. Calling the getter function will return a promise that will be resolved with the config object that contains the properties listed below.

The customerId and adminId is not suited for authentication. For authenticating customers an Authentication Token should be used.
This utility works in iframes as well, but the UI Kit and window.e.config must be present on top window, otherwise the promise won't resolve.

Utility Reference

window.e.utils.getConfig()

window.e.utils.getConfig().then(config => {
  console.log('customerId is: ' + config.customerId);
});

Return value

Type Description
A promise that resolves to the config object

The config object contains the following fields:

Name Type Description
accountTimezone The timezone setting of the currently logged in customer account
adminFirstName The first name of the currently logged in admin
adminId The adminId of the currently logged in admin
adminLastName The last name of the currently logged in admin
customerId The customerId of the currently logged in customer account
dateFormat The preferred date format of the currently logged in admin
environment The name (domain) of the current environment
enviromentHost The name (domain) of the current UI host (e.g. when using a CDN)
features The array of enabled features for the account
flippers The array of turned on flippers for the account
language The preferred language of the currently logged in admin
services A list of additional fields provided by various services
sessionId The public id of the current session
timeFormat The preferred time format of the currently logged in admin
timezone The timezone setting for the currently logged in admin