mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-07-23 20:42:02 +00:00
7d2a22c45a
Co-authored-by: Pablo F.G <pablo.fernandez@prowler.com> Co-authored-by: César Arroba <19954079+cesararroba@users.noreply.github.com>
18 lines
527 B
TypeScript
18 lines
527 B
TypeScript
"use client";
|
|
|
|
import {
|
|
EMPTY_RUNTIME_PUBLIC_CONFIG,
|
|
readRuntimeConfigIsland,
|
|
type RuntimePublicConfig,
|
|
} from "@/lib/runtime-config.shared";
|
|
|
|
let cached: RuntimePublicConfig | null = null;
|
|
|
|
// Reads the <head> island once (memoized); all-null during SSR or if it's
|
|
// missing/malformed, so callers can treat every integration as disabled.
|
|
export function getRuntimeConfigClient(): RuntimePublicConfig {
|
|
if (cached) return cached;
|
|
cached = readRuntimeConfigIsland() ?? EMPTY_RUNTIME_PUBLIC_CONFIG;
|
|
return cached;
|
|
}
|