govuk-prototype-kit
govuk-prototype-kit copied to clipboard
Allow plugins to use config in config.js
Context
In writing a plugin, I'd like to be able to change the behaviour of the plugin based on the config in config.js.
For example, I'd like to turn on/off logging the session data in the terminal.
This needs to be safe against other plugins so, namespaced something like:
{
"serviceName": "abc",
"pluginConfig": {
"govuk-frontend": {
"globalStyles": false
},
"home-office-kit": {
"logData": true
}
}
}
Alternatives
Not currently using a workaround.
Additional information (if applicable)
This will make it easier for plugins to try new features and functionality.
Done when
- [ ] We have designed the API user experience
- [ ] The API user experience is approved within the team
- [ ] A plugin developer can access the config relevant to their plugin
I've implemented something that is like the functionality that I'm looking for: https://github.com/UKHomeOffice/home-office-kit/blob/main/routes/all.js in the Home Office kit