diff --git a/packages/calling/src/Metrics/index.ts b/packages/calling/src/Metrics/index.ts index 85816286f5d..6e2ef686c08 100644 --- a/packages/calling/src/Metrics/index.ts +++ b/packages/calling/src/Metrics/index.ts @@ -286,7 +286,7 @@ class MetricManager implements IMetricManager { fields: { device_url: this.deviceInfo?.device?.clientDeviceUri, calling_sdk_version: - process && process.env.CALLING_SDK_VERSION + typeof process !== 'undefined' && process.env.CALLING_SDK_VERSION ? process.env.CALLING_SDK_VERSION : VERSION, }, @@ -306,7 +306,10 @@ class MetricManager implements IMetricManager { }, fields: { device_url: this.deviceInfo?.device?.clientDeviceUri, - calling_sdk_version: process.env.CALLING_SDK_VERSION || VERSION, + calling_sdk_version: + typeof process !== 'undefined' && process.env.CALLING_SDK_VERSION + ? process.env.CALLING_SDK_VERSION + : VERSION, }, type, };