# Kirby::plugin setting for passing data to the panel Vue front end

**URL:** <https://forum.getkirby.com/t/kirby-plugin-setting-for-passing-data-to-the-panel-vue-front-end/13268>\
**Category:** Questions\
**Tags:** v3\
**Created:** [March 8, 2019, 2:45pm UTC](https://forum.getkirby.com/t/kirby-plugin-setting-for-passing-data-to-the-panel-vue-front-end/13268 "2019-03-08T14:45:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hdodov](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/hdodov/32/8171_2.png) [@hdodov](https://forum.getkirby.com/u/hdodov)\
**Post date:** [March 8, 2019, 2:45pm UTC](https://forum.getkirby.com/t/kirby-plugin-setting-for-passing-data-to-the-panel-vue-front-end/13268/1 "2019-03-08T14:45:59Z")

</div>

See [this post](https://forum.getkirby.com/t/how-to-pass-data-to-panel-plugins-front-end/13252/5) for more information and a use case for what I’m about to describe.

* * *

It would be very useful to be able to pass some static server data to your plugin’s panel view. In the source of the panel page, you can see:

```auto
<script>window.panel = {"url":"http://localhost/ikarov/panel","site":"http://localhost/ikarov","api":"http://localhost/ikarov/api","csrf":"9e1534bfa938023d64360efbfedb4ed29fa2bf7e1d41b71efc5d96d66c34d964","translation":"en","debug":true,"search":{"limit":10}}</script>

```

This way, the panel Vue app gets some necessary server data. Well, my suggestion is to provide a way to add more data to this object. For example:

plugin’s `index.php`:

```php
Kirby::plugin('hdodov/myplugin', [
  'panelData' => [
    'myvalue' => 42
  ];
]);

```

Then, in your `index.js`:

```js
console.log(window.panel.plugins.data.myplugin.myvalue) // 42

```

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [March 8, 2019, 7:24pm UTC](https://forum.getkirby.com/t/kirby-plugin-setting-for-passing-data-to-the-panel-vue-front-end/13268/2 "2019-03-08T19:24:42Z")

</div>

Could you add your suggestion to our idea repository? [https://github.com/getkirby/ideas/issues](https://github.com/getkirby/ideas/issues)

This way the community can vote on all ideas which helps to inform our decision for the roadmap.

As written in my reply to your other post, you can still query API data from your component upon initialization of the component. This works great for my plugins – and also is how most of the Panel itself gets its information (besides these few variables that are crucial for starting the Panel.

---

<div class="post-metadata">

**Author:** ![hdodov](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/hdodov/32/8171_2.png) [@hdodov](https://forum.getkirby.com/u/hdodov)\
**Post date:** [March 11, 2019, 10:36am UTC](https://forum.getkirby.com/t/kirby-plugin-setting-for-passing-data-to-the-panel-vue-front-end/13268/3 "2019-03-11T10:36:06Z")

</div>

Yep, I can query the data. But in order to do that, I would need to:

1. Create a new API endpoint
2. Use AJAX to load the data, which may be unnecessary bloat
3. Because the data is loaded via AJAX, the plugin needs to wait for the data
4. Due to the plugin having to wait for the necessary data, I need to delay its initialization which [doesn’t seem to happen easily](https://forum.getkirby.com/t/asynchronous-plugin-panel-view-registration/13272/3?u=hdodov)

It would be much simpler to just:

1. Read the data

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [March 11, 2019, 10:50am UTC](https://forum.getkirby.com/t/kirby-plugin-setting-for-passing-data-to-the-panel-vue-front-end/13268/4 "2019-03-11T10:50:10Z")

</div>

Depending on what you do it might also slow down every panel page load - no matter if the plugin itself is involved or not. Not saying that this shouldn’t be an option therefore. But also here a concrete use case would help a lot to an informed decision.

---

<div class="post-metadata">

**Author:** ![hdodov](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/hdodov/32/8171_2.png) [@hdodov](https://forum.getkirby.com/u/hdodov)\
**Post date:** [March 11, 2019, 11:23am UTC](https://forum.getkirby.com/t/kirby-plugin-setting-for-passing-data-to-the-panel-vue-front-end/13268/5 "2019-03-11T11:23:44Z")

</div>

I agree. My use case is kind of an edge case because I need that initial data in order to create a Vuex store and then start the plugin app. Pretty sure that a great portion of plugins don’t have that. Therefore it might not be a very important feature to have, but I should at least be able to _initialize_ the plugin _after_ the data is loaded over API. That would be enough for me, and it’s [not yet possible](https://forum.getkirby.com/t/asynchronous-plugin-panel-view-registration/13272/2).
