mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
Add note about direct access to other plugins config (#43340)
This commit is contained in:
parent
d388abee9b
commit
4de1acf4fb
1 changed files with 12 additions and 1 deletions
|
@ -1093,7 +1093,18 @@ _See also: [Server's CoreSetup API Docs](/docs/development/core/server/kibana-pl
|
|||
|
||||
### Configure plugin
|
||||
Kibana provides ConfigService if a plugin developer may want to support adjustable runtime behavior for their plugins. Access to Kibana config in New platform has been subject to significant refactoring.
|
||||
In order to have access to a config, plugin *should*:
|
||||
|
||||
Config service does not provide access to the whole config anymore. New platform plugin cannot read configuration parameters of the core services nor other plugins directly. Use plugin contract to provide data.
|
||||
|
||||
```js
|
||||
// your-plugin.js
|
||||
// in Legacy platform
|
||||
const basePath = config.get('server.basePath');
|
||||
// in New platform
|
||||
const basePath = core.http.basePath.get(request);
|
||||
```
|
||||
|
||||
In order to have access to your plugin config, you *should*:
|
||||
- Declare plugin specific "configPath" (will fallback to plugin "id" if not specified) in `kibana.json` file.
|
||||
- Export schema validation for config from plugin's main file. Schema is mandatory. If a plugin reads from the config without schema declaration, ConfigService will throw an error.
|
||||
```typescript
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue