Skip to content

Commit

Permalink
Add note about direct access to other plugins config (#43340)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshustov authored and joshdover committed Aug 23, 2019
1 parent d388abe commit 4de1acf
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/core/MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4de1acf

Please sign in to comment.