# uiExport options

**URL:** <https://discuss.elastic.co/t/uiexport-options/103601>\
**Category:** Kibana\
**Created:** [October 11, 2017, 7:03pm UTC](https://discuss.elastic.co/t/uiexport-options/103601 "2017-10-11T19:03:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![havidarou](https://avatars.discourse-cdn.com/v4/letter/h/3ec8ea/32.png) [@havidarou](https://discuss.elastic.co/u/havidarou)\
**Post date:** [October 11, 2017, 7:03pm UTC](https://discuss.elastic.co/t/uiexport-options/103601/1 "2017-10-11T19:03:46Z")

</div>

Hi,

I am developing an app type plugin, and I've been lookint into Kibana code.

I've noticed this in the index.js of the Kibana core plugin itself:

```
 app: {
        id: 'kibana',
        title: 'Kibana',
        listed: false,
        description: 'the kibana you know and love',
        main: 'plugins/kibana/kibana',
        uses: [
          'visTypes',
          'visResponseHandlers',
          'visRequestHandlers',
          'visEditorTypes',
          'savedObjectTypes',
          'spyModes',
          'fieldFormats',
          'fieldFormatEditors',
          'navbarExtensions',
          'managementSections',
          'devTools',
          'docViews'
        ],
        injectVars,
      },

```

What is the 'uses' part? and the injectVars part?

Thanks!

---

<div class="post-metadata">

**Author:** ![timroes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timroes/32/19712_2.png) [@timroes](https://discuss.elastic.co/u/timroes)\
**Post date:** [October 12, 2017, 1:11pm UTC](https://discuss.elastic.co/t/uiexport-options/103601/2 "2017-10-12T13:11:53Z")

</div>

The `injectVars` part of the description, must point to a function, which returns an object (see e.g. the [timelion sources](https://github.com/elastic/kibana/blob/8f346335bf18aa08dfbf54490019b66a2383ee16/src/core_plugins/timelion/index.js#L23)).

This values are mostly used for to read out configuration options and make them available in the sources. The variables you return here, can either be injected in Angular by their name, or you have access to them via:

```auto
import chrome from 'ui/chrome';
chrome.getInjected('name-here', 'default-value-if-not-present');

```

The `uses` key is used to declare "dependencies" and used to build bundles later on. Orientate yourself at the existing plugins (mostly the list above) to see possible values, and only inject what you need in your application.

---

<div class="post-metadata">

**Author:** ![havidarou](https://avatars.discourse-cdn.com/v4/letter/h/3ec8ea/32.png) [@havidarou](https://discuss.elastic.co/u/havidarou)\
**Post date:** [October 12, 2017, 4:47pm UTC](https://discuss.elastic.co/t/uiexport-options/103601/3 "2017-10-12T16:47:24Z")

</div>

Thank you Tim.

But what are they exactly? I mean, what is a spyMode, for example?

Regards.

---

<div class="post-metadata">

**Author:** ![timroes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timroes/32/19712_2.png) [@timroes](https://discuss.elastic.co/u/timroes)\
**Post date:** [October 13, 2017, 10:55am UTC](https://discuss.elastic.co/t/uiexport-options/103601/4 "2017-10-13T10:55:02Z")

</div>

`spyModes` are the different modes you have when inspecting a visualization via the panel, that shows the request, response:

 ![screenshot-20171013-124951](https://us1.discourse-cdn.com/elastic/original/3X/6/0/600aff88a562d2b44b39425aac07604e2f820e20.png)

So "requests", "response", "table", "statistics" and "debug" are existing spy modes. If you don't want to add anything new to this debug panel, you won't need it.

In general I would recommend, that you try start building what you need, and only look into these if you have the feeling something isn't working for you.

---

<div class="post-metadata">

**Author:** ![havidarou](https://avatars.discourse-cdn.com/v4/letter/h/3ec8ea/32.png) [@havidarou](https://discuss.elastic.co/u/havidarou)\
**Post date:** [October 30, 2017, 3:51pm UTC](https://discuss.elastic.co/t/uiexport-options/103601/5 "2017-10-30T15:51:14Z")

</div>

ok, thank you @timroes

---

<div class="post-metadata">

**Author:** ![havidarou](https://avatars.discourse-cdn.com/v4/letter/h/3ec8ea/32.png) [@havidarou](https://discuss.elastic.co/u/havidarou)\
**Post date:** [October 31, 2017, 11:21am UTC](https://discuss.elastic.co/t/uiexport-options/103601/6 "2017-10-31T11:21:23Z")

</div>

Hi again @timroes,

I've been looking into the `navbarExtensions` one, is it related to using kbn-top-nav directives in your app?

How would you go about doing that?

And also, if the `uses` part declares dependencies, then what's the diference from the `require` part?

For example, Timelion has 'kibana' and 'elasticsearch' in the `require` part, what's the diference from 'spyMode' in the `uses` part?

Regards.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 28, 2017, 11:21am UTC](https://discuss.elastic.co/t/uiexport-options/103601/7 "2017-11-28T11:21:26Z")

</div>

Closed on November 28, 2017, 11:21am UTC

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