### [How to add service-worker to a separate folder?](https://www.pushengage.com/documentation/how-to-add-service-worker-to-a-separate-folder/)

**Published:** November 21, 2022
**Author:** Ayushi Dubey

**Content:**

The service worker is the key file to complete the subscription and ensures subscribers are collected on your domain. If you use the native opt-in, adding the service-worker.js file to the root or sub-directory is an important installation step. If you don’t have access to the root directory, but to a subfolder, you can still add the service-worker.js file and complete the installation. Here are the steps to follow –

- Add the service-worker.js file to your subdirectory or a separate folder and copy the path to that folder.
- Login to your PushEngage dashboard and navigate to ***Site Settings > Advanced Settings***
- Add the path for your service-worker.js file and save the changes.

![](https://cdn-std.droplr.net/files/acc_1121161/mnMuQk)That will be it once these changes are saved, your installation is complete.

Your registration of a service worker will be from PushEngage and through a sub-folder instead of the root directory.

If in case you run into any issues, please feel free to [**contact us**](https://www.pushengage.com/contact-us/?utm_source=website&utm_medium=helpdocs&utm_campaign=contact-us) by clicking here. Our support team will be able to help you.

**Doc Categories:** Getting Started, Web Push

---

