# Service Worker React Plugin

**URL:** <https://discuss.elastic.co/t/service-worker-react-plugin/186482>\
**Category:** Kibana\
**Created:** [June 19, 2019, 1:58pm UTC](https://discuss.elastic.co/t/service-worker-react-plugin/186482 "2019-06-19T13:58:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dkelsen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dkelsen/32/46291_2.png) [@dkelsen](https://discuss.elastic.co/u/dkelsen)\
**Post date:** [June 19, 2019, 1:58pm UTC](https://discuss.elastic.co/t/service-worker-react-plugin/186482/1 "2019-06-19T13:58:16Z")

</div>

Hi,

I was wondering whether it's possible to use a service worker in the ReactJS Kibana plugin?

The following command is failing  
`navigator.serviceWorker.register("serviceWorker.js")`  
and I'm assuming the reason is because that file doesn't exist at the root of my application (e.g. [http://localhost:5601/hzn/app/serviceWorker.js](http://localhost:5601/hzn/app/serviceWorker.js))

So the question is, where is the root of my application in my folder? Because it doesn't appear to be the `public` folder.

Regards,  
Dilshan

---

<div class="post-metadata">

**Author:** ![lukas](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas/32/6812_2.png) [@lukas](https://discuss.elastic.co/u/lukas)\
**Post date:** [June 19, 2019, 8:41pm UTC](https://discuss.elastic.co/t/service-worker-react-plugin/186482/2 "2019-06-19T20:41:50Z")

</div>

Hmm, I don't believe you'll be able to accomplish this in the current system, because there's currently no way to specify which JavaScript files you want to serve statically outside of what gets built using our build system. You may want to open a GitHub issue requesting the ability to do this.

---

<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:** [July 17, 2019, 8:42pm UTC](https://discuss.elastic.co/t/service-worker-react-plugin/186482/3 "2019-07-17T20:42:02Z")

</div>

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