Problem
stx's public environment support substitutes browser values during build. Deploying the same built artifact to environments with different public API URLs therefore needs additional application plumbing or another build.
A runtime configuration API would let the server resolve deployment-specific values and expose only the declared public subset to the browser.
Evidence
Reviewed at 7d93c4c: public-env.ts explicitly implements build-time substitutions. This request complements that existing behavior.
Scope and acceptance criteria
- Declare typed configuration defaults with explicit public and server-only sections.
- Resolve documented environment overrides when the production server starts.
- Expose the public subset consistently during SSR and browser hydration.
- Keep private keys out of HTML payloads, client bundles, and client type access.
- Preserve current import.meta.env build-time substitution for existing apps.
- Test one build served with two different runtime configurations.
- Define SPA navigation behavior and document limitations for fully static deployments.
- Provide a documented API with inferred types and predictable override rules.
Prior art: Nuxt runtime config.