Ship production deployment and runtime observability
This commit is contained in:
parent
267665bb35
commit
775dd61963
1 changed files with 3712 additions and 175 deletions
|
|
@ -12,6 +12,12 @@ interface RemoraRuntimeConfig {
|
|||
oidcScope: string
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
remoraRuntimeConfig?: Partial<RemoraRuntimeConfig>
|
||||
}
|
||||
}
|
||||
|
||||
export function createBrowserRuntime(): WebClientRuntime {
|
||||
const config = runtimeConfig()
|
||||
const session = new BrowserOidcSession({
|
||||
|
|
@ -29,23 +35,35 @@ export function createBrowserRuntime(): WebClientRuntime {
|
|||
}
|
||||
|
||||
function runtimeConfig(): RemoraRuntimeConfig {
|
||||
const apiUrl = import.meta.env.VITE_REMORA_API_URL ?? '/api/v1/'
|
||||
const injected = window.remoraRuntimeConfig ?? {}
|
||||
const apiUrl =
|
||||
injected.apiUrl ?? import.meta.env.VITE_REMORA_API_URL ?? '/v1/'
|
||||
return {
|
||||
apiUrl,
|
||||
eventsUrl:
|
||||
injected.eventsUrl ??
|
||||
import.meta.env.VITE_REMORA_EVENTS_URL ??
|
||||
new URL('events', websocketBase(apiUrl)).toString(),
|
||||
oidcAuthority:
|
||||
injected.oidcAuthority ??
|
||||
import.meta.env.VITE_REMORA_OIDC_AUTHORITY ??
|
||||
new URL('/oidc', window.location.origin).toString(),
|
||||
oidcClientId: import.meta.env.VITE_REMORA_OIDC_CLIENT_ID ?? 'remora-web',
|
||||
oidcClientId:
|
||||
injected.oidcClientId ??
|
||||
import.meta.env.VITE_REMORA_OIDC_CLIENT_ID ??
|
||||
'remora-web',
|
||||
oidcRedirectUri:
|
||||
injected.oidcRedirectUri ??
|
||||
import.meta.env.VITE_REMORA_OIDC_REDIRECT_URI ??
|
||||
new URL('/', window.location.origin).toString(),
|
||||
oidcPostLogoutRedirectUri:
|
||||
injected.oidcPostLogoutRedirectUri ??
|
||||
import.meta.env.VITE_REMORA_OIDC_POST_LOGOUT_REDIRECT_URI ??
|
||||
new URL('/', window.location.origin).toString(),
|
||||
oidcScope: import.meta.env.VITE_REMORA_OIDC_SCOPE ?? 'openid profile',
|
||||
oidcScope:
|
||||
injected.oidcScope ??
|
||||
import.meta.env.VITE_REMORA_OIDC_SCOPE ??
|
||||
'openid profile',
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue