Skip to content
8 changes: 5 additions & 3 deletions packages/common/src/config/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ const STAGING_API = Boolean(JSON.stringify(process.env.STAGING_API));

const AB_TESTING_URL_STAGING = 'https://ab-testing.codesandbox.stream';
const AB_TESTING_URL_PRODUCTION = 'https://ab-testing.codesandbox.io';
export const AB_TESTING_URL = STAGING_API
? AB_TESTING_URL_STAGING
: AB_TESTING_URL_PRODUCTION;
export const AB_TESTING_URL = /codesandbox\.io/.test(
typeof window !== `undefined` ? window?.location?.host : ''
)
? AB_TESTING_URL_PRODUCTION
: AB_TESTING_URL_STAGING;

export const getExperimentUserId = () => {
const KEY_NAME = 'csb-ab-user-id';
Expand Down