Files
story/web/src/runtimeConfig.ts
T

21 lines
620 B
TypeScript
Raw Normal View History

2026-08-26 06:41:07 +08:00
declare global {
interface Window {
__VOICE_PLATFORM_CONFIG__?: {
oidcAuthority?: string;
oidcClientId?: string;
};
}
}
function configuredValue(value: string | undefined, fallback: string): string {
const normalized = value?.trim();
return normalized ? normalized : fallback;
}
export const runtimeConfig = Object.freeze({
oidcAuthority: configuredValue(window.__VOICE_PLATFORM_CONFIG__?.oidcAuthority, "http://localhost:58180/realms/voice-local").replace(/\/+$/, ""),
oidcClientId: configuredValue(window.__VOICE_PLATFORM_CONFIG__?.oidcClientId, "voice-platform-web")
});
export {};