diff options
| author | rxliuli <rxliuli@gmail.com> | 2025-11-04 05:03:50 +0800 |
|---|---|---|
| committer | rxliuli <rxliuli@gmail.com> | 2025-11-04 05:03:50 +0800 |
| commit | bce557cc2dc767628bed6aac87301a1be7c5431b (patch) | |
| tree | b51a051228d01fe3306cd7626d4a96768aadb944 /src/config/errorkit.ts | |
init commit
Diffstat (limited to 'src/config/errorkit.ts')
| -rw-r--r-- | src/config/errorkit.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/config/errorkit.ts b/src/config/errorkit.ts new file mode 100644 index 0000000..4178680 --- /dev/null +++ b/src/config/errorkit.ts @@ -0,0 +1,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, +}; |
