ConfigReader.getOptional()
Home > @backstage/config
> ConfigReader
> getOptional
Read out all configuration data for the given key.
Usage of this method should be avoided as the typed alternatives provide much better error reporting. The main use-case of this method is to determine the type of a configuration value in the case where there are multiple possible shapes of the configuration.
Signature:
getOptional<T = JsonValue>(key?: string): T | undefined;
Parameters
Parameter |
Type |
Description |
---|---|---|
key |
string |
(Optional) |
T | undefined