Bus UI Portal
RuntimeConfig publishes safe browser configuration.
Use RuntimeConfig when a portal module needs public values such as locale, module id, static asset bases, or feature flags at mount time.
Public API
| Package | github.com/busdk/bus-ui/pkg/uiportal |
|---|---|
| Render config | PublicRuntimeConfigRender, RenderPublicRuntimeConfig |
| Host context | HostRuntimeConfigScriptChecked |
| Validate | ValidatePublicRuntimeConfig |
Use It For
Keep secrets, tokens, private filesystem paths, and provider credentials out of this object. Hosts should pass only values that browser code may safely inspect.
Example
config := uiportal.PublicRuntimeConfigRender{
ElementID: "bus-ui-runtime-config",
Config: map[string]any{
"locale": "fi-FI",
},
}
html, err := uiportal.RenderPublicRuntimeConfig(config)
