|
| 1 | +import { LogLevelDesc } from "loglevel"; |
| 2 | + |
| 3 | +import { |
| 4 | + AUTH_SERVER_URL, |
| 5 | + BUILD_ENV, |
| 6 | + DEVELOP_AUTH_SERVER_URL, |
| 7 | + DEVELOP_PASSWORDLESS_SERVER_API_URL, |
| 8 | + PASSWORDLESS_SERVER_API_URL, |
| 9 | +} from "../utils/constants"; |
| 10 | +import { BUILD_ENV_TYPE } from "../utils/interfaces"; |
| 11 | + |
| 12 | +export interface ConfigBuild { |
| 13 | + // add discord revoke api in backend |
| 14 | + apiHost: string; // auth backend |
| 15 | + passwordlessBackendHost: string; |
| 16 | + passwordlessHost: string; |
| 17 | + sentrySampleRate: string; |
| 18 | + sentryTransactionSampleRate: string; |
| 19 | + supportsVersioning: boolean; |
| 20 | + logLevel: LogLevelDesc; |
| 21 | +} |
| 22 | + |
| 23 | +const configBuild: Record<BUILD_ENV_TYPE, ConfigBuild> = { |
| 24 | + [BUILD_ENV.DEVELOPMENT]: { |
| 25 | + apiHost: `${DEVELOP_AUTH_SERVER_URL}`, |
| 26 | + logLevel: "debug", |
| 27 | + passwordlessBackendHost: `${DEVELOP_PASSWORDLESS_SERVER_API_URL}/api/v3/`, |
| 28 | + passwordlessHost: "https://develop-passwordless.web3auth.io", |
| 29 | + sentrySampleRate: "0", |
| 30 | + sentryTransactionSampleRate: "0", |
| 31 | + supportsVersioning: false, |
| 32 | + }, |
| 33 | + [BUILD_ENV.STAGING]: { |
| 34 | + apiHost: AUTH_SERVER_URL, |
| 35 | + logLevel: "debug", |
| 36 | + passwordlessBackendHost: `${PASSWORDLESS_SERVER_API_URL}/api/v3/`, |
| 37 | + passwordlessHost: "https://staging-passwordless.web3auth.io/v6", |
| 38 | + sentrySampleRate: "0.1", |
| 39 | + sentryTransactionSampleRate: "0.1", |
| 40 | + supportsVersioning: true, |
| 41 | + }, |
| 42 | + [BUILD_ENV.PRODUCTION]: { |
| 43 | + apiHost: AUTH_SERVER_URL, |
| 44 | + logLevel: "error", |
| 45 | + passwordlessBackendHost: `${PASSWORDLESS_SERVER_API_URL}/api/v3/`, |
| 46 | + passwordlessHost: "https://passwordless.web3auth.io/v6", |
| 47 | + sentrySampleRate: "0.5", |
| 48 | + sentryTransactionSampleRate: "0.001", |
| 49 | + supportsVersioning: true, |
| 50 | + }, |
| 51 | + [BUILD_ENV.TESTING]: { |
| 52 | + apiHost: DEVELOP_AUTH_SERVER_URL, |
| 53 | + logLevel: "debug", |
| 54 | + passwordlessBackendHost: `${DEVELOP_PASSWORDLESS_SERVER_API_URL}/api/v3/`, |
| 55 | + passwordlessHost: "https://develop-passwordless.web3auth.io", |
| 56 | + sentrySampleRate: "1", |
| 57 | + sentryTransactionSampleRate: "0.1", |
| 58 | + supportsVersioning: false, |
| 59 | + }, |
| 60 | +}; |
| 61 | + |
| 62 | +export default configBuild; |
0 commit comments