Accessing URL parameters in application plugin

Hi,

I have created a custom Kibana plugin of type 'app'. In this plugin, I would like to access URL parameters. Unfortunately, I was not able to find relevant documentation that would explain how this needs to be done. I noticed that _g and _a parameters are used, but I do not know what is the proper way to access these in my plugin code. Could you please point me to some documentation or examples that explain this?

Thank you very much!

Hi @bundaskifli,

Are you building a "new platform" plugin?
If so, I don't think there is a documented way to access _a or _g in "new platform" plugin in 7.6.x version. You could try to listen for browser location events yourself and get the data from query params yourself.

In 7.6.x kibana apps plugins are using this code for writing and reading from/to _a / _g query params: link . These are angularJs services and if your plugin is a legacy plugin and built with angularjs, then you could try to use those services.

In master and in 7.7 branch there are new state syncing utils available which would be a recommenced way to sync state with url. But it is not available in 7.6.x: docs

Hello Anton,

thanks very much for looking into this. Sorry I forgot to mention the Kibana version - I am building on 7.5.2. Unfortunately, upgrading is not an option for me.