How to server.plugins.xpack_main.registerFeature on the new platform?

Hi,

I have created a basic plugin using the plugin generator, and I have been reading documentation about different legacy functionality and the new platform equivalents. However, I cannot find an example of how to register a feature using xpack from this documentation (which is in the legacy format). I see that the current version of the documentation doesn't have this page anymore. Is there any documentation or guidance I can follow to register a feature so that I can use the ui capabilities (or whatever the equivalent is in the new platform)?

Thanks!

Hey there!

Our plugin documentation is being updated with the roll out of the new platform. In the mean time, checkout this migration doc in the kibana repo: https://github.com/elastic/kibana/blob/master/src/core/MIGRATION.md#plugin-services

The registerFeature function has migrated to the features plugin. So, in the new plugin system, you'll have to add the features plugin as a dependency and then you can call plugin.features.registerFeature from your plugin's setup function. You can see how Canvas does it here: https://github.com/elastic/kibana/blob/master/x-pack/plugins/canvas/server/plugin.ts#L40

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.