You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support user-defined configuration in <runMode>.yaml with type-safe access and validation #633
An option is also to do the configuration in code, rather than having it in a config file. Or just load a different config file depending on you run mode. You can access the run mode from Serverpod.instance!.runmode. It can be set to one of: ServerpodRunMode.development, ServerpodRunMode.staging, or ServerpodRunMode.production.
I will update the title of this issue to cover some additional requirements.
Description
To support advanced use cases and plugins, it should be possible for developers to extend the <runMode>.yaml configuration file with their own custom configuration options. These custom configurations should integrate seamlessly with Serverpod’s existing configuration system.
Requirements
Developers should be able to register additional configuration fields under custom namespaces.
It must be possible to specify validation rules and metadata for each configuration field:
Whether the field is required or optional.
Default values for optional fields.
Serverpod should produce a typed configuration object for the custom configuration:
This type can either be supplied by the user at registration or generated by Serverpod.
The resolution order for custom configuration values must match the standard Serverpod configuration system:
Values from environment variables should override values from the configuration file (<runMode>.yaml).
Clear error messages when required fields are missing or have invalid types.
changed the title [-]Custom fields in config files ?[/-][+]Support user-defined configuration in `<runMode>.yaml` with type-safe access and validation[/+]on Jun 4, 2025
Activity
vlidholt commentedon Feb 9, 2023
That would be a nice addition! I guess it's technically possible to use the passwords file for this until this feature is implemented.
dufguix commentedon Feb 10, 2023
Yes for sure. I'll create a passwords.yaml template without passwords to be able to git push.
vlidholt commentedon Feb 10, 2023
An option is also to do the configuration in code, rather than having it in a config file. Or just load a different config file depending on you run mode. You can access the run mode from
Serverpod.instance!.runmode. It can be set to one of:ServerpodRunMode.development,ServerpodRunMode.staging, orServerpodRunMode.production.dufguix commentedon Feb 10, 2023
Thanks. Good to know
Serverpod.instance!.runmode.egyleader commentedon May 3, 2023
I can see this is already implemented in serverpod 1.1.0 , I think this issue should be closed

migalv commentedon Nov 28, 2024
It seems it's not yet implemented if I'm not mistaken. I think this would be very cool to have.
SandPod commentedon Jun 4, 2025
I will update the title of this issue to cover some additional requirements.
Description
To support advanced use cases and plugins, it should be possible for developers to extend the
<runMode>.yamlconfiguration file with their own custom configuration options. These custom configurations should integrate seamlessly with Serverpod’s existing configuration system.Requirements
<runMode>.yaml).[-]Custom fields in config files ?[/-][+]Support user-defined configuration in `<runMode>.yaml` with type-safe access and validation[/+]