# Accessing config options from plugin's Created() hook in js. Is it possible?

**URL:** <https://forum.getkirby.com/t/accessing-config-options-from-plugins-created-hook-in-js-is-it-possible/19920>\
**Category:** Questions\
**Tags:** v3\
**Created:** [October 31, 2020, 7:03am UTC](https://forum.getkirby.com/t/accessing-config-options-from-plugins-created-hook-in-js-is-it-possible/19920 "2020-10-31T07:03:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vbadvanced](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/vbadvanced/32/9242_2.png) [@vbadvanced](https://forum.getkirby.com/u/vbadvanced)\
**Post date:** [October 31, 2020, 7:03am UTC](https://forum.getkirby.com/t/accessing-config-options-from-plugins-created-hook-in-js-is-it-possible/19920/1 "2020-10-31T07:03:29Z")

</div>

Hey everyone.  
I want to access and use my plugin options from config file in a panel plugin.

Here is the code:

```
panel.plugin("vbadvanced/kirby-persian", {
  created(app) {
    // Here I want to accces my "vbadvanced.kirby-persian.site.calendar" option.
  },
  components: {},
  fields: {},
});

```

In the field plugins its as easy as reading and passing options as props for field. but in my case I want to read options and conditionally set some html attributes on the DOM.

Thanks in advance 🙏

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [October 31, 2020, 9:40am UTC](https://forum.getkirby.com/t/accessing-config-options-from-plugins-created-hook-in-js-is-it-possible/19920/2 "2020-10-31T09:40:56Z")

</div>

I _think_ you have to fetch the config options via a custom api endpoint. They don’t seem to be globally accessible.

---

<div class="post-metadata">

**Author:** ![bvdputte](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bvdputte/32/8179_2.png) [@bvdputte](https://forum.getkirby.com/u/bvdputte)\
**Post date:** [October 31, 2020, 10:20am UTC](https://forum.getkirby.com/t/accessing-config-options-from-plugins-created-hook-in-js-is-it-possible/19920/3 "2020-10-31T10:20:02Z")

</div>

Maybe you could use the [system-loadplugins-after](https://getkirby.com/docs/reference/plugins/hooks/system-loadplugins-after) hook somehow for this?

Once this fires, Kirby is in a loaded stated which has the options from `config.php` available via the `option()` helpers.

---

<div class="post-metadata">

**Author:** ![vbadvanced](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/vbadvanced/32/9242_2.png) [@vbadvanced](https://forum.getkirby.com/u/vbadvanced)\
**Post date:** [October 31, 2020, 12:11pm UTC](https://forum.getkirby.com/t/accessing-config-options-from-plugins-created-hook-in-js-is-it-possible/19920/4 "2020-10-31T12:11:36Z")

</div>

Thanks @texnixe , Actually I’ve considered this as the last possible solution. Maybe it’s the only solution to this. 🙄  
Currently I’m working on a new panel plugin to add support for Persian (Farsi) features to the panel and frontend.

Thanks you for your reply 🙏

---

<div class="post-metadata">

**Author:** ![vbadvanced](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/vbadvanced/32/9242_2.png) [@vbadvanced](https://forum.getkirby.com/u/vbadvanced)\
**Post date:** [October 31, 2020, 12:15pm UTC](https://forum.getkirby.com/t/accessing-config-options-from-plugins-created-hook-in-js-is-it-possible/19920/5 "2020-10-31T12:15:39Z")

</div>

I’m looking to access options in my **js** code. The [system-loadplugins-after](https://getkirby.com/docs/reference/plugins/hooks/system-loadplugins-after) hook is for backend php code.  
I don’t know if it’s possible to add any piece of metadata to loaded plugins and use it in frontend later?
