Ask a Dev
Extension > Getting Client ID and Environment on Running Application
over 3 years ago by Learning Experience Team(edited)
From Russell:
Sometimes, it's essential to know whether you're running in a Sandbox or the Live environment and to verify the Client ID of the instance you're running on. This can be done in the extension using the following:
ExtensionContext is part of the SettingsService (ISettingsService), which can be injected.
Once you've got the handle to SettingsService, do this:
string clientId = _settingsService.ExtensionContext().ClientId; // IE, "demo"
DirectScale.Disco.Extension.EnvironmentType envType = _settingsService.ExtensionContext().EnvironmentType;
// EnvironmentType is an enum, and can be either Sandbox or Live