Files
dancefinder-app/app/utils/environment.ts
T
argoyleandClaude Opus 5.5 21471104c6
dancefinder-app / build (pull_request) Successful in 3m54s
dancefinder-app / deploy-prod-frostmoln (pull_request) Skipped
fix: send Faro telemetry to self-hosted Alloy collector
Switch production Faro URL from Grafana Cloud to https://faro.unbound.se/collect (Alloy faro.receiver in the Frostmoln Platform stack).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSC7dLAgao1afzL5DQfH8F
2026-10-18 20:36:38 +02:00

50 lines
1.2 KiB
TypeScript

import type { Auth0ClientOptions, CacheLocation } from '@auth0/auth0-spa-js'
interface EnvConfig {
name: string
apiUrl: string
auth: Auth0ClientOptions
dev: boolean
tracesSampleRate: number
grafanaUrl: string
}
export const envConfig = (host: string): EnvConfig => {
const options = {
useRefreshTokens: true,
cacheLocation: 'localstorage' as CacheLocation,
authorizationParams: {
audience: 'http://dancefinder.unbound.se',
redirect_uri: window.location.origin,
},
}
const prod = {
...options,
domain: 'unbound.eu.auth0.com',
clientId: 'orQfnvCPUR5C3mJkKoiWLQHOVQsBn60e',
}
switch (host) {
case 'localhost':
return {
name: 'development',
apiUrl: 'http://localhost:6080/query',
auth: prod,
dev: true,
tracesSampleRate: 1.0,
grafanaUrl: '',
}
case 'dancefinder.unbound.se':
return {
name: 'production',
apiUrl: 'https://dancefinder.unbound.se/query',
auth: prod,
dev: false,
tracesSampleRate: 1.0,
grafanaUrl: 'https://faro.unbound.se/collect',
}
default:
throw new Error(`unexpected host: ${host}`)
}
}