Hi,
I need help in a use case. I am developing two custom plugins (say P1 & P2) . And I want to embed P2 into P1. (May be multiple plugins also).
Can you please help me how to do this?
Hi,
I need help in a use case. I am developing two custom plugins (say P1 & P2) . And I want to embed P2 into P1. (May be multiple plugins also).
Can you please help me how to do this?
Kibana plugins don't have the concept of extending other plugins directly, but many plugins choose to expose specific extension points to allow other plugins to enhance their functionality.
What are you trying to develop and achieve?
cc @timroes for more detailed inputs.
Hi,
in principal every plugin in the Kibana plugin infrastructure (so called Kibana Platform) can expose APIs. An API can be any bit of JavaScript code, thus you can expose e.g. an extension point in P1, that any other plugin can register something into that should be rendered, or your plugins could expose specific components.
You can find an overview of the Kibana platform here: kibana/kibana_platform_plugin_intro.mdx at master · elastic/kibana · GitHub
Also existing Kibana plugins are always a good reference if you need to figure out how to build something. If you can provide more specific details what you mean by "embedding" and the interaction between P1 and P2, I might be able to point you towards better fitting example plugins or Kibana plugins for reference.
Cheers,
Tim
Hi,
Thanks for your explanation.
This is what I am trying to do.
Thanks
Hi,
in this case it would make most sense that you return that download method as part of the plugin implementing the download method. Basically the API is whatever you return from the start
method in your plugin.js/ts file, e.g.
import { downloadHelper } from './download';
class YourPlugin {
start() {
return {
download: downloadHelper,
};
}
}
In your plugin that should consume that now, you'll need to make that other plugin a dependency in its kibana.json
via the requiredPlugins
key (have a look at any plugin in the Kibana repository under src/plugins/ to get an idea about that file (or check the above linked documentation).
In that case your plugin will now get passed in the API of your other plugin into it's start method as the second parameter, i.e. you'll have something like:
class ConsumingPlugin {
start(core, dependencies) {
// Call this to trigger download API of other plugin:
dependencies.yourPluginId.download();
}
}
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.