@microsoft/omnichannel-chat-sdk
Version:
Microsoft Omnichannel Chat SDK
27 lines • 1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getOmnichannelChatSdkVersion = void 0;
var settings_1 = require("../config/settings");
/**
* Gets the omnichannel-chat-sdk version.
*
* In most environments, this will successfully read from package.json.
* In rare bundled environments where this fails, it falls back to the
* version from settings (manually maintained).
*/
var getOmnichannelChatSdkVersion = function () {
try {
// Try dynamic loading - works in 99% of cases
var packageJson = require('../../package.json');
if (packageJson && packageJson.version && packageJson.version !== "0.0.0-0") {
return packageJson.version;
}
}
catch (error) {
return settings_1.omnichannelChatSdkVersion;
}
// Fallback to settings version
return settings_1.omnichannelChatSdkVersion;
};
exports.getOmnichannelChatSdkVersion = getOmnichannelChatSdkVersion;
//# sourceMappingURL=version.js.map