summaryrefslogtreecommitdiff
path: root/src/config/errorkit.ts
blob: 4178680ee51da0ca8d106869f2972364c14bf270 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { BUILD } from './build';
import type { ErrorKitConfig } from '@amp/web-apps-logger/src/errorkit';

const APPS_PROD_SUBDOMAIN = ['apps'];
const PROJECT_ID = 'onyx_apps';

const getSentryEnv = () => {
    const location =
        typeof window !== 'undefined' && window.location.host.split('.')[0];
    return APPS_PROD_SUBDOMAIN.includes(location) ? 'prod' : 'dev';
};

export const ERROR_KIT_CONFIG: ErrorKitConfig = {
    project: PROJECT_ID,
    environment: getSentryEnv(),
    release: BUILD,
};