MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / buildRuntimeEnvScript

Function buildRuntimeEnvScript

packages/cli/src/server/studioServer.ts:642–651  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

640 // process.env and inject them as `window.__HF_STUDIO_ENV__` so the client
641 // can pick them up at runtime, overriding the baked defaults.
642 function buildRuntimeEnvScript(): string {
643 const overrides: Record<string, string> = {};
644 for (const [key, value] of Object.entries(process.env)) {
645 if (key.startsWith("VITE_STUDIO_") && value !== undefined) {
646 overrides[key] = value;
647 }
648 }
649 if (Object.keys(overrides).length === 0) return "";
650 return `<script>window.__HF_STUDIO_ENV__=${JSON.stringify(overrides)};</script>`;
651 }
652
653 // SPA fallback
654 app.get("*", (c) => {

Callers 1

createStudioServerFunction · 0.85

Calls 1

entriesMethod · 0.80

Tested by

no test coverage detected